diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-03 22:50:11 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-04 09:15:22 -0500 |
commit | f49313bb87e0dc2ee20f5621c6858d119e5f8f83 (patch) | |
tree | ba1902c3f1ee2f5aa54f75ebe533d58d07755ba5 /bpmn/MSOCommonBPMN/src/test/groovy/org/onap | |
parent | a5bb70becba912f172615b873c4921a2a88dcf3e (diff) |
Bugfixes for December 2018
Changed the way that the cidr is constructed in network utils.
added in the if statement to check if selflink already exists
removed execution line that was not needed in pull
added service instance id to workflowResourceIds for virtualLinkKey
network flows
wrote test for updating request to complete in db
workflow action directly updates db instead of using mso complete
process
Increase max timeout for SDNO Health Checks dmaap.
Added execution variable and corrected type and way data is retrieved
to fix defect
fixed retry status message in request db for #/5
updated workflowActionBBTasks for flow status message
updated flow status to failed on a workflowaction fail
Removed slashes and fixed rollbackStatusMessage
Updated requestStatus logic for adding status messages
Added junit test to validate casue of a defect and cleaned up code and
logging
added end timestamp to request db on complete request
fixed l3Network update of orchestation status in
DoUpdateNetworkInstance groovy as well
fixed update of l3network orchestration status
Add explicit resetting of heatStackId in A&AI to DeleteVfModule and
DeleteVolumeGroup BBs.
Preserve heatStackId setting in the copiedVfModule when updating the VF
Module in A&AI.
added functionality to skip rollback based on flag
Update snapshot version for logging, add headers
fixed optional of error in retrieveErrorMessage method
Set heatStackId to null if we want to remove it in A&AI.
added in a warn logger statement to keep track of field
map network technology from l3network instead of model info for network
adapter object mapper
Force heatStackId value to empty on an attempt to set it to null on
update
updated common pom to use aai schema version 1.4.1
removed handle sync error from SDNCHandler bpmn flow
Change-Id: I1bd7aa55b06d4e439000b216165c9daafeacc9a4
Issue-ID: SO-1361
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/groovy/org/onap')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy index 77edd2dc6d..72cde00877 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -34,14 +34,14 @@ import static org.junit.Assert.*; @RunWith(MockitoJUnitRunner.class) public class VnfAdapterRestV1Test { - + @Before public void init() { MockitoAnnotations.initMocks(this) } - + @Test public void testPreProcessRequest() { @@ -59,11 +59,11 @@ public class VnfAdapterRestV1Test { when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") when(mockExecution.getVariable("testProcessKey")).thenReturn("testProcessKey") - + VnfAdapterRestV1 vnfAdapterRestV1 = new VnfAdapterRestV1() vnfAdapterRestV1.preProcessRequest(mockExecution) - + MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() //debugger.printInvocations(mockExecution) @@ -78,7 +78,7 @@ public class VnfAdapterRestV1Test { verify(mockExecution).setVariable("VNFREST_vnfAdapterUrl","http://localhost:18080/vnfs/rest/v1/vnfs/6d2e2469-8708-47c3-a0d4-73fa28a8a50b/vf-modules") } - + def rollbackReq = """ <rollbackVolumeGroupRequest> <volumeGroupRollback> @@ -97,7 +97,7 @@ public class VnfAdapterRestV1Test { <notificationUrl>http://localhost:8080/mso/WorkflowMessage/VNFAResponse/683ca1ac-2145-4a00-9484-20d48bd701aa</notificationUrl> </rollbackVolumeGroupRequest> """ - + @Test public void testGetVolumeGroupId() { Node root = new XmlParser().parseText(rollbackReq) @@ -106,13 +106,29 @@ public class VnfAdapterRestV1Test { assertEquals('8a07b246-155e-4b08-b56e-76e98a3c2d66', volGrpId) } - + @Test public void testGetMessageId() { Node root = new XmlParser().parseText(rollbackReq) - + VnfAdapterRestV1 p = new VnfAdapterRestV1() def messageId = p.getMessageIdForVolumeGroupRollback(root) assertEquals('683ca1ac-2145-4a00-9484-20d48bd701aa', messageId) } + + @Test + public void testProcessCallback() { + + String sdncAdapterWorkflowRequest = FileUtil.readResourceFile("__files/vnfAdapterMocks/vnfAdapterCallback.xml"); + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + + when(mockExecution.getVariable("VNFAResponse_MESSAGE")).thenReturn(sdncAdapterWorkflowRequest) + when(mockExecution.getVariable("testProcessKey")).thenReturn("testProcessKey") + + VnfAdapterRestV1 vnfAdapterRestV1 = new VnfAdapterRestV1() + vnfAdapterRestV1.processCallback(mockExecution) + + verify(mockExecution).setVariable("testProcessKeyResponse" ,sdncAdapterWorkflowRequest) + + } } |