aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-03 22:50:11 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-04 09:15:22 -0500
commitf49313bb87e0dc2ee20f5621c6858d119e5f8f83 (patch)
treeba1902c3f1ee2f5aa54f75ebe533d58d07755ba5 /bpmn/so-bpmn-infrastructure-common/src/test/groovy/org
parenta5bb70becba912f172615b873c4921a2a88dcf3e (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/so-bpmn-infrastructure-common/src/test/groovy/org')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy45
1 files changed, 23 insertions, 22 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy
index 11dbf7d2ee..7523427c84 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceTest.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.
@@ -43,9 +43,11 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.MockitoAnnotations
import org.mockito.runners.MockitoJUnitRunner
+import org.onap.aai.domain.yang.L3Network
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
-
+import org.onap.so.client.aai.AAIResourcesClient
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.junit.WireMockRule
import org.apache.commons.lang3.*
@@ -480,7 +482,7 @@ class DoCreateNetworkInstanceTest {
<host-route-id>string</host-route-id>
<route-prefix>192.10.16.0/24</route-prefix>
<next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
+ <next-hop-type>ip-address</next-hop-type>
<resource-version>1505857301954</resource-version>
</host-route>
<host-route>
@@ -508,7 +510,7 @@ class DoCreateNetworkInstanceTest {
<host-route-id>string</host-route-id>
<route-prefix>192.10.16.0/24</route-prefix>
<next-hop>192.10.16.100/24</next-hop>
- <next-hop-type>ip-address</next-hop-type>
+ <next-hop-type>ip-address</next-hop-type>
<resource-version>1505857301954</resource-version>
</host-route>
</host-routes>
@@ -1669,7 +1671,7 @@ String createNetworkRequest_Ipv4 =
<notificationUrl/>
</createNetworkRequest>"""
-String createNetworkRequestAlaCarte =
+String createNetworkRequestAlaCarte =
"""<createNetworkRequest>
<cloudSiteId>RDM2WAGPLCP</cloudSiteId>
<tenantId>7dd5365547234ee8937416c65507d266</tenantId>
@@ -1874,8 +1876,8 @@ String createNetworkRequest_SRIOV =
<serviceInstanceId/>
</msoRequest>
</networkRollback>
-</rollbackNetworkRequest>"""
-
+</rollbackNetworkRequest>"""
+
String createNetworkResponse =
"""<ns2:createNetworkResponse xmlns:ns2="http://org.onap.so/network"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
@@ -3053,7 +3055,7 @@ String sdncAdapterWorkflowAssignResponse =
when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest) // JSON format
when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") // 1610 default
when(mockExecution.getVariable("disableRollback")).thenReturn(true)
-
+
when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
@@ -3182,8 +3184,8 @@ String sdncAdapterWorkflowAssignResponse =
verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest)
}
-
-
+
+
@Test
//@Ignore
public void prepareCreateNetworkRequest_Ipv4() {
@@ -3220,7 +3222,7 @@ String sdncAdapterWorkflowAssignResponse =
verify(mockExecution).setVariable(Prefix + "createNetworkRequest", createNetworkRequest_Ipv4)
}
-
+
@Test
//@Ignore
public void prepareCreateNetworkRequest_AlaCarte() {
@@ -3712,7 +3714,7 @@ String sdncAdapterWorkflowAssignResponse =
//MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
//preDebugger.printInvocations(mockExecution)
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix)
verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
@@ -3791,7 +3793,7 @@ String sdncAdapterWorkflowAssignResponse =
verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
}
-
+
@Test
//@Ignore
public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() {
@@ -4025,26 +4027,25 @@ String sdncAdapterWorkflowAssignResponse =
@Test
//@Ignore
public void callRESTUpdateContrailAAINetworkREST_200() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
+ AAIResourcesClient mockClient = mock(AAIResourcesClient.class)
WireMock.reset();
- MockPutNetworkIdWithDepth("CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
+ L3Network network = new L3Network()
+ //TODO need to inject mock
ExecutionEntity mockExecution = setupMock()
when(mockExecution.getVariable(Prefix + "networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(network)
when(mockExecution.getVariable(Prefix + "createNetworkResponse")).thenReturn(createNetworkResponseREST)
when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+
// old: when(mockExecution.getVariable("mso.workflow.DoCreateNetworkInstance.aai.network.l3-network.uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
when(mockExecution.getVariable("mso.workflow.DoCreateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("false")
when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ doNothing().when(mockClient).update(isA(AAIResourceUri.class), isA(L3Network.class))
// preProcessRequest(DelegateExecution execution)
DoCreateNetworkInstance DoCreateNetworkInstance = new DoCreateNetworkInstance()
DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
@@ -4102,7 +4103,7 @@ String sdncAdapterWorkflowAssignResponse =
}
-
+
@Test
//@Ignore