From 164596ffc56c1f9a4418a2f3b8f3941896b124f7 Mon Sep 17 00:00:00 2001 From: Mateusz Gołuchowski Date: Thu, 5 Nov 2020 15:47:23 +0100 Subject: Update VID SO API call generation - include PNF instanceName parameter in SO API call (macro) Creation of functionality to prepare service with PNF request which call SO. Issue-ID: VID-695 Signed-off-by: Mateusz Goluchowski Change-Id: I5285ac2ab5e95665244ca18c6549249d9330b1ed --- .../services/AsyncInstantiationBusinessLogicTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java') diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java index 284efce45..5ff05a471 100644 --- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java @@ -409,7 +409,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT @Test(dataProvider = "pauseAndInstanceParams") public void createMacroServiceInstantiationMsoRequestUniqueName(Boolean isPause, HashMap vfModuleInstanceParamsMap, List vnfInstanceParams) throws Exception { defineMocks(); - ServiceInstantiation serviceInstantiationPayload = generateMockMacroServiceInstantiationPayload(isPause, createVnfList(vfModuleInstanceParamsMap, vnfInstanceParams, true), 2, true, PROJECT_NAME, false); + ServiceInstantiation serviceInstantiationPayload = generateMockMacroServiceInstantiationPayload(isPause, createVnfList(vfModuleInstanceParamsMap, vnfInstanceParams, true), null, 2, true, PROJECT_NAME, false); final URL resource = this.getClass().getResource("/payload_jsons/bulk_service_request_unique_names.json"); when(jobAdapterMock.createServiceInstantiationJob(any(), any(), any(), any(), any(), anyString(), any())).thenAnswer(invocation -> { Object[] args = invocation.getArguments(); @@ -481,7 +481,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT final ServiceInstantiation request = generateMockMacroServiceInstantiationPayload( false, createVnfList(instanceParamsMapWithoutParams, Collections.EMPTY_LIST, true), - bulkSize, isUserProvidedNaming, projectName, true + createPnfList(), bulkSize, isUserProvidedNaming, projectName, true ); // in "createServiceInstantiationJob()" we will probe the service, with the generated names @@ -618,7 +618,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT ServiceInstantiation macroPayload = generateMockMacroServiceInstantiationPayload( false, createVnfList(instanceParamsMapWithoutParams, ImmutableList.of(vnfInstanceParamsMapWithParamsToRemove, vnfInstanceParamsMapWithParamsToRemove), true), - 2, false,PROJECT_NAME, false); + createPnfList(), 2, false,PROJECT_NAME, false); ServiceInstantiation aLaCartePayload = generateALaCarteServiceInstantiationPayload(); return new Object[][]{ @@ -733,7 +733,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT @Test(dataProvider = "isPauseAndPropertyDataProvider") public void testServiceInstantiationPath_RequestPathIsAsExpected(boolean isPause, String expectedProperty) { - ServiceInstantiation serviceInstantiationPauseFlagTrue = generateMacroMockServiceInstantiationPayload(isPause, createVnfList(instanceParamsMapWithoutParams, Collections.EMPTY_LIST, true)); + ServiceInstantiation serviceInstantiationPauseFlagTrue = generateMacroMockServiceInstantiationPayload(isPause, createVnfList(instanceParamsMapWithoutParams, Collections.EMPTY_LIST, true), createPnfList()); String path = asyncInstantiationBL.getServiceInstantiationPath(serviceInstantiationPauseFlagTrue); Assert.assertEquals(path, SystemProperties.getProperty(expectedProperty)); } @@ -752,7 +752,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT final ServiceInstantiation request = generateMockMacroServiceInstantiationPayload( false, createVnfList(instanceParamsMapWithoutParams, Collections.EMPTY_LIST, true), - 100, true,PROJECT_NAME, true + createPnfList(), 100, true,PROJECT_NAME, true ); pushJobAndAssertDates(startTestDate, request); @@ -1013,7 +1013,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT @Test public void pushBulkJob_verifyMacroFlow_useMacroServiceInstantiationJobType(){ - final ServiceInstantiation request = generateMacroMockServiceInstantiationPayload(false, Collections.emptyMap()); + final ServiceInstantiation request = generateMacroMockServiceInstantiationPayload(false, Collections.emptyMap(), Collections.emptyMap()); // in "createServiceInstantiationJob()" we will probe the service, with the generated names configureMockitoWithMockedJob(); @@ -1064,7 +1064,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT public void whenLcpRegionNotEmpty_thenCloudRegionIdOfServiceIsLegacy() { String legacyCloudRegion = "legacyCloudRegion"; ServiceInstantiation service = new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null, - null, null, "anyCloudRegion", legacyCloudRegion, null, null, null, null, null, null, null, null, null, + null, null, "anyCloudRegion", legacyCloudRegion, null, null, null, null, null, null, null, null, null, null, false, 1,false, false, null, null, Action.Create.name(), UUID.randomUUID().toString(), null, null, null, "originalName"); assertThat(service.getLcpCloudRegionId(), equalTo(legacyCloudRegion)); } @@ -1087,7 +1087,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT @NotNull protected ServiceInstantiation createServiceWithIsALaCarteAndAction(boolean isALaCarte, Action action) { return new ServiceInstantiation(new ModelInfo(), null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, 1, false, isALaCarte, null, null, action.name(), UUID.randomUUID().toString(), null, null, null, "originalName"); } -- cgit 1.2.3-korg