aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-19 09:44:51 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-19 09:44:51 +0000
commit497e040b5569b0b0139a5cbc8115a63bc7f99244 (patch)
tree4e2a8c3a09bfb7d3a0bbbdc773c0e9ec702d8e4a /vid-app-common/src/test/java/org
parent421fd2a498707d5844e9a99eed039ddcb8b52e06 (diff)
parent804882648e0c7c4bc8016870017ec43a6156253c (diff)
Merge "Disable homing_solution"6.0.0
Diffstat (limited to 'vid-app-common/src/test/java/org')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBusinessLogicTest.java1
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/MsoRequestBuilderTest.java20
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