aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/test
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-05 16:24:37 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-06-06 11:26:38 -0400
commit560e84158798cb884de65e3cf33ab657f0e6e6df (patch)
tree83a5aedb750eed64fcff623742bebc63a2a07161 /bpmn/so-bpmn-infrastructure-common/src/test
parent5f4c4f3f3215eb136f9c4f84f51dc8fcd5fe0353 (diff)
parent59eff996497691e0fc82b627dcda306e861655b3 (diff)
Merge remote-tracking branch 'origin/dublin' into 'origin/master'
Change-Id: I551ea3f29a76dc99532455ea4d7e84a316f9bf38 Issue-ID: SO-1980 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/test')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy17
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml22
2 files changed, 30 insertions, 9 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
index faa6a0e395..5a6ad4291e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.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.
@@ -47,6 +47,9 @@ import static org.mockito.Mockito.*
class DoCreateVfModuleTest {
def prefix = "DCVFM_"
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(8090);
+
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@@ -54,7 +57,7 @@ class DoCreateVfModuleTest {
void init() throws IOException {
MockitoAnnotations.initMocks(this);
}
-
+
@Test
void testQueryAAIVfModule() {
ExecutionEntity mockExecution = setupMock()
@@ -90,7 +93,7 @@ class DoCreateVfModuleTest {
Mockito.verify(mockExecution).setVariable("DCVFM_queryAAIVfModuleForStatusResponseCode", 200)
}
-
+
@Test
void testPreProcessVNFAdapterRequest() {
@@ -122,7 +125,7 @@ class DoCreateVfModuleTest {
map.put("vrr_image_name", "MDT17");
map.put("availability_zone_0", "nova");
map.put("vrr_flavor_name", "ns.c16r32d128.v1");
- when(mockExecution.getVariable("vnfParamsMap")).thenReturn(map)
+ when(mockExecution.getVariable(prefix + "vnfParamsMap")).thenReturn(map)
when(mockExecution.getVariable("mso-request-id")).thenReturn("testRequestId-1503410089303")
when(mockExecution.getVariable("mso.use.qualified.host")).thenReturn("true")
when(mockExecution.getVariable("mso.workflow.message.endpoint")).thenReturn("http://localhost:28080/mso/WorkflowMesssage")
@@ -155,7 +158,7 @@ class DoCreateVfModuleTest {
Mockito.verify(mockExecution).setVariable(prefix + "queryCloudRegionReturnCode", "200")
}
-
+
@Test
void testCreateNetworkPoliciesInAAI() {
@@ -181,7 +184,7 @@ class DoCreateVfModuleTest {
Mockito.verify(mockExecution).setVariable(prefix + "aaiQqueryNetworkPolicyByFqdnReturnCode", 200)
}
-
+
private static ExecutionEntity setupMock() {
ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml
index f78d38f802..782936c382 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml
@@ -1,5 +1,6 @@
<createVfModuleRequest>
<cloudSiteId>RDM2WAGPLCP</cloudSiteId>
+ <cloudOwner>null</cloudOwner>
<tenantId>fba1bd1e195a404cacb9ce17a9b2b421</tenantId>
<vnfId>skask</vnfId>
<vnfName>skask-test</vnfName>
@@ -47,6 +48,10 @@
<value>null</value>
</entry>
<entry>
+ <key>user_directives</key>
+ <value>{ &quot;attributes&quot;: [{&quot;attribute_name&quot;:&quot;vrr_image_name&quot;,&quot;attribute_value&quot;:&quot;MDT17&quot;},{&quot;attribute_name&quot;:&quot;availability_zone_0&quot;,&quot;attribute_value&quot;:&quot;nova&quot;},{&quot;attribute_name&quot;:&quot;vrr_flavor_name&quot;,&quot;attribute_value&quot;:&quot;ns.c16r32d128.v1&quot;}]}</value>
+ </entry>
+ <entry>
<key>vf_module_name</key>
<value>PCRF::module-0-2</value>
</entry>
@@ -71,6 +76,10 @@
<value></value>
</entry>
<entry>
+ <key>vrr_flavor_name</key>
+ <value>ns.c16r32d128.v1</value>
+ </entry>
+ <entry>
<key>ADIG_SRIOV_2_net_name</key>
<value>ADIG_SRIOV_2</value>
</entry>
@@ -103,6 +112,10 @@
<value>null</value>
</entry>
<entry>
+ <key>sdnc_directives</key>
+ <value>{ &quot;attributes&quot;: [{&quot;attribute_name&quot;:&quot;vf_module_id&quot;,&quot;attribute_value&quot;:&quot;cb510af0-5b21-4bc7-86d9-323cb396ce32&quot;},{&quot;attribute_name&quot;:&quot;vrra_Internal-Network1_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_2_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIGOam.OAM_v6_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;vnf_name&quot;,&quot;attribute_value&quot;:&quot;skask-test&quot;},{&quot;attribute_name&quot;:&quot;ADIGOam.OAM_v6_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;workload_context&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;vf_module_name&quot;,&quot;attribute_value&quot;:&quot;PCRF::module-0-2&quot;},{&quot;attribute_name&quot;:&quot;vnf_id&quot;,&quot;attribute_value&quot;:&quot;skask&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_2_v6_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIG_SRIOV_1_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_1_v6_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_1_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_2_net_name&quot;,&quot;attribute_value&quot;:&quot;ADIG_SRIOV_2&quot;},{&quot;attribute_name&quot;:&quot;ADIGOam.OAM_subnet_id&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;ADIGOam.OAM_net_id&quot;,&quot;attribute_value&quot;:&quot;491c7cef-a3f4-4990-883e-b0af397466d0&quot;},{&quot;attribute_name&quot;:&quot;environment_context&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_1_net_fqdn&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;ADIGOam.OAM_net_name&quot;,&quot;attribute_value&quot;:&quot;ADIGOAM.OAM&quot;},{&quot;attribute_name&quot;:&quot;vrra_name_0&quot;,&quot;attribute_value&quot;:&quot;frkdevRvrra24&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIG_SRIOV_2_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_2_net_fqdn&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;vrra_Internal-Network2_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_1_net_name&quot;,&quot;attribute_value&quot;:&quot;ADIG_SRIOV_1&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIG_SRIOV_1_v6_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIGOam.OAM_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;vrra_Internal-Network1_v6_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIGOam.OAM_net_fqdn&quot;,&quot;attribute_value&quot;:&quot;&quot;},{&quot;attribute_name&quot;:&quot;vrra_names&quot;,&quot;attribute_value&quot;:&quot;frkdevRvrra24&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_1_net_id&quot;,&quot;attribute_value&quot;:&quot;491c7cef-a3f4-4990-883e-b0af397466d0&quot;},{&quot;attribute_name&quot;:&quot;vrra_Internal-Network2_v6_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;vrra_ADIG_SRIOV_2_v6_ips&quot;,&quot;attribute_value&quot;:&quot;null&quot;},{&quot;attribute_name&quot;:&quot;ADIG_SRIOV_2_net_id&quot;,&quot;attribute_value&quot;:&quot;491c7cef-a3f4-4990-883e-b0af397466d0&quot;},{&quot;attribute_name&quot;:&quot;vf_module_index&quot;,&quot;attribute_value&quot;:&quot;index&quot;},{&quot;attribute_name&quot;:&quot;availability_zone_0&quot;,&quot;attribute_value&quot;:&quot;frkde-esx-az01&quot;}]}</value>
+ </entry>
+ <entry>
<key>ADIG_SRIOV_2_net_fqdn</key>
<value></value>
</entry>
@@ -127,6 +140,10 @@
<value>null</value>
</entry>
<entry>
+ <key>vrr_image_name</key>
+ <value>MDT17</value>
+ </entry>
+ <entry>
<key>ADIGOam.OAM_net_fqdn</key>
<value></value>
</entry>
@@ -156,9 +173,10 @@
</entry>
<entry>
<key>availability_zone_0</key>
- <value>frkde-esx-az01</value>
+ <value>nova</value>
</entry>
+
</vfModuleParams>
<msoRequest>
<requestId>testRequestId</requestId>
@@ -166,4 +184,4 @@
</msoRequest>
<messageId>testRequestId-1503410089303-1513204371234</messageId>
<notificationUrl>http://localhost:28080/mso/WorkflowMesssage/VNFAResponse/testRequestId-1503410089303-1513204371234</notificationUrl>
-</createVfModuleRequest> \ No newline at end of file
+</createVfModuleRequest>