diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2020-03-08 17:54:30 +0200 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-03-11 13:27:24 +0200 |
commit | f31dd5a7446ad4d692d2cdb6af4eba662e3925e3 (patch) | |
tree | 89c08ed32afd580651486704ebe1220ea1363a2a | |
parent | 617318d1b7700c9d9720255b2bf54f6ce401c8c9 (diff) |
add new format to fetch requests from MSO to the CM
When flag is true VID will use the format=simpleNoTaskInfo parameter in addition to the filter parameter when fetching orchestration requests for the change-management dashboard.
Issue-ID: VID-787
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Change-Id: I18d608db5bab6f095f399ac0f58fe5e49944a6b1
Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com>
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
7 files changed, 36 insertions, 9 deletions
diff --git a/features.properties.md b/features.properties.md index 505a82bcf..23d92829e 100644 --- a/features.properties.md +++ b/features.properties.md @@ -225,4 +225,8 @@ * FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT When flag is true the platform will appear as a multi select field, if false the platform will be dropdown list. -
\ No newline at end of file + + +* FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD + When flag is true VID will use the format=simpleNoTaskInfo parameter in addition to the filter parameter when fetching orchestration requests for the change-management dashboard. + When OFF, VID will use only the filter parameter
\ No newline at end of file diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java index 4e7a77cd3..764be03bb 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java @@ -75,8 +75,8 @@ public class MsoConfig { @Bean - public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient){ - return new MsoBusinessLogicImpl(msoClient); + public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient, FeatureManager featureManager){ + return new MsoBusinessLogicImpl(msoClient, featureManager ); } @Bean diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java index 8f9b98a55..2e141adfd 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java @@ -88,9 +88,11 @@ import org.onap.vid.mso.rest.RequestList; import org.onap.vid.mso.rest.RequestWrapper; import org.onap.vid.mso.rest.Task; import org.onap.vid.mso.rest.TaskList; +import org.onap.vid.properties.Features; import org.onap.vid.utils.Logging; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.togglz.core.manager.FeatureManager; public class MsoBusinessLogicImpl implements MsoBusinessLogic { @@ -123,9 +125,13 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { */ private final MsoInterface msoClientInterface; + + private final FeatureManager featureManager; + @Autowired - public MsoBusinessLogicImpl(MsoInterface msoClientInterface) { + public MsoBusinessLogicImpl(MsoInterface msoClientInterface, FeatureManager featureManager) { this.msoClientInterface = msoClientInterface; + this.featureManager = featureManager; } public static String validateEndpointPath(String endpointEnvVariable) { @@ -381,9 +387,20 @@ public class MsoBusinessLogicImpl implements MsoBusinessLogic { return dashboardOrchestrationReqs; } + private String simpleNoTaskInfoFilter() + { + if (featureManager.isActive(Features.FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD)) { + return "format=simpleNoTaskInfo&"; + } + + return ""; + + } + private String constructOrchestrationRequestFilter(String filterName, String filterValue) { - return String.format("%sfilter=%s:EQUALS:%s", - SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS), filterName, filterValue); + + return String.format("%s%sfilter=%s:EQUALS:%s", + SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS),simpleNoTaskInfoFilter(), filterName, filterValue); } private List<RequestWrapper> getOrchestrationRequestsByFilter(String filterName, String filterValue) { diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java index 5e966a989..e52571906 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java @@ -90,6 +90,7 @@ public enum Features implements Feature { FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF, FLAG_EXP_TOPOLOGY_TREE_VFMODULE_NAMES_FROM_OTHER_TOSCA_VERSIONS, FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT, + FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD, ; diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerNewTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerNewTest.java index 03a6c40f3..68d1706c0 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerNewTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerNewTest.java @@ -36,7 +36,7 @@ public class MsoControllerNewTest { private MsoController createTestSubject() { try { - return new MsoController(new MsoBusinessLogicImpl(mock(MsoInterface.class)), mock(RestMsoImplementation.class), + return new MsoController(new MsoBusinessLogicImpl(mock(MsoInterface.class), null), mock(RestMsoImplementation.class), new CloudOwnerServiceImpl(null, null)); } catch (Exception e) { return null; diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java index 83fff4f5d..9d5577c7d 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java @@ -104,6 +104,7 @@ import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import org.togglz.core.manager.FeatureManager; @ContextConfiguration(classes = {SystemProperties.class}) public class MsoBusinessLogicImplTest extends AbstractTestNGSpringContextTests { @@ -123,6 +124,10 @@ public class MsoBusinessLogicImplTest extends AbstractTestNGSpringContextTests { @Mock private RequestDetails msoRequest; + @Mock + private FeatureManager featureManager; + + private MsoBusinessLogicImpl msoBusinessLogic; private String userId = "testUserId"; @@ -131,7 +136,7 @@ public class MsoBusinessLogicImplTest extends AbstractTestNGSpringContextTests { @BeforeClass public void setUp() { MockitoAnnotations.initMocks(this); - msoBusinessLogic = new MsoBusinessLogicImpl(msoInterface); + msoBusinessLogic = new MsoBusinessLogicImpl(msoInterface, featureManager); } @Test diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java index 0ea5f2947..7b9bfac34 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java @@ -49,7 +49,7 @@ import org.testng.annotations.Test; public class MsoOperationalEnvironmentTest { - private MsoBusinessLogic msoBusinessLogic = new MsoBusinessLogicImpl(null); + private MsoBusinessLogic msoBusinessLogic = new MsoBusinessLogicImpl(null, null); private static final Logger logger = LogManager.getLogger(MsoOperationalEnvironmentTest.class); @Test(dataProvider = "getOperationalEnvironmentActivationPermutations") |