diff options
author | wsliwka <wojciech.sliwka@nokia.com> | 2019-09-17 14:31:42 +0200 |
---|---|---|
committer | wsliwka <wojciech.sliwka@nokia.com> | 2019-09-19 10:26:48 +0200 |
commit | 804882648e0c7c4bc8016870017ec43a6156253c (patch) | |
tree | eb1ba96a9072277f2f07f8ef72af4855d510524c /vid-app-common/src/test/java | |
parent | 6e08835bcfe44b02f73d349b0d87aa3591bc45e4 (diff) |
Disable homing_solution
Send Homing_solution=none during macro instantiation
Add flag 'FLAG_DISABLE_HOMING' (by default set to true) which defines
whether homing_solution should be in request to so or not
Issue-ID: VID-576
Signed-off-by: wsliwka <wojciech.sliwka@nokia.com>
Change-Id: I6151151a0256a5bb4e637acf08ae511f4b265dc2
Signed-off-by: wsliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src/test/java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java | 1 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java | 20 |
2 files changed, 17 insertions, 4 deletions
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 2b4f4be62..ce0aa42f2 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 @@ -190,6 +190,7 @@ public class AsyncInstantiationBusinessLogicTest extends AsyncInstantiationBaseT @BeforeClass void initServicesInfoService() { MockitoAnnotations.initMocks(this); + doReturn(false).when(featureManager).isActive(Features.FLAG_DISABLE_HOMING); AsyncInstantiationRepository realAsyncInstantiationRepository = new AsyncInstantiationRepository(dataAccessService); asyncInstantiationRepository = spy(realAsyncInstantiationRepository); diff --git a/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java b/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java index bd761f275..2c70b3ddc 100644 --- a/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java @@ -26,6 +26,7 @@ import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.IsEqual.equalTo; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -85,6 +86,7 @@ import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.togglz.core.manager.FeatureManager; @ContextConfiguration(classes = {DataSourceConfig.class, SystemProperties.class, MockedAaiClientAndFeatureManagerConfig.class}) public class MsoRequestBuilderTest extends AsyncInstantiationBaseTest { @@ -138,22 +140,32 @@ public class MsoRequestBuilderTest extends AsyncInstantiationBaseTest { @Test public void createServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected() throws IOException { - createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(true); + createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(true, + false); } @Test public void createServiceInfo_WithUserProvidedNamingFalseAndNoVfmodules_ServiceInfoIsAsExpected() throws IOException { - createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(false); + createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(false, false); } - private void createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(boolean withVfmodules) throws IOException { + @Test + public void shouldCreateServiceInfoWithHomingSolutionDisabled() throws IOException { + doReturn(true).when(featureManager).isActive(Features.FLAG_DISABLE_HOMING); + + createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(true, true); + } + + private void createMacroServiceInfo_WithUserProvidedNamingFalse_ServiceInfoIsAsExpected(boolean withVfmodules, boolean disabledHoming) throws IOException { ServiceInstantiation serviceInstantiationPayload = generateMockMacroServiceInstantiationPayload(true, createVnfList(vfModuleInstanceParamsMapWithParamsToRemove, Collections.EMPTY_LIST, false), 1, false, PROJECT_NAME, true); URL resource; - if (withVfmodules) { + if (disabledHoming) { + resource = this.getClass().getResource("/payload_jsons/bulk_service_no_homing.json"); + } else if (withVfmodules) { resource = this.getClass().getResource("/payload_jsons/bulk_service_request_ecomp_naming.json"); } else { // remove the vf modules |