From 6c009875e53796b0b79a7bd8010590651d2af028 Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Tue, 30 Apr 2019 01:20:09 -0700 Subject: build sndc and user directives in groovy Fill out the sdnc_directives and user_directives used by the multicloud vnf plugin adapter when invoked via the groovy path. Change-Id: Ia11680be682b38756f188c71e3e000bc21c15aa9 Issue-ID: SO-1822 Signed-off-by: Eric Multanen --- .../infrastructure/scripts/DoCreateVfModuleTest.groovy | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src/test/groovy') 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 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) -- cgit 1.2.3-korg