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>
* 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
@Bean
- public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient){
- return new MsoBusinessLogicImpl(msoClient);
+ public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient, FeatureManager featureManager){
+ return new MsoBusinessLogicImpl(msoClient, featureManager );
}
@Bean
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 {
*/
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) {
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) {
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,
;
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;
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 {
@Mock
private RequestDetails msoRequest;
+ @Mock
+ private FeatureManager featureManager;
+
+
private MsoBusinessLogicImpl msoBusinessLogic;
private String userId = "testUserId";
@BeforeClass
public void setUp() {
MockitoAnnotations.initMocks(this);
- msoBusinessLogic = new MsoBusinessLogicImpl(msoInterface);
+ msoBusinessLogic = new MsoBusinessLogicImpl(msoInterface, featureManager);
}
@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")