Merge "Upgrade vfModule popup: show modelVersionId and invariantiD from instance...
authorIttay Stern <ittay.stern@att.com>
Thu, 12 Mar 2020 09:17:26 +0000 (09:17 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 12 Mar 2020 09:17:26 +0000 (09:17 +0000)
features.properties.md
vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
vid-app-common/src/main/java/org/onap/vid/properties/Features.java
vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerNewTest.java
vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java
vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java
vid-app-common/src/test/java/org/onap/vid/services/JobsBrokerServiceTest.java
vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java
vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java

index 505a82b..23d9282 100644 (file)
   
 * 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
index 4e7a77c..764be03 100644 (file)
@@ -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
index 8f9b98a..2e141ad 100644 (file)
@@ -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) {
index 5e966a9..e525719 100644 (file)
@@ -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,
 
     ;
 
index 03a6c40..68d1706 100644 (file)
@@ -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;
index 83fff4f..9d5577c 100644 (file)
@@ -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
index 0ea5f29..7b9bfac 100644 (file)
@@ -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")
index 20c9d14..db20217 100644 (file)
@@ -115,7 +115,7 @@ public class JobsBrokerServiceTest extends AbstractTestNGSpringContextTests {
 
     private final Set<Long> threadsIds = new ConcurrentSkipListSet<>();
 
-    private final long FEW = 500;
+    private final long FEW = 1000;
 
     private final String JOBS_SHOULD_MATCH = "the jobs that added and those that pulled must be the same";
     private final String JOBS_PEEKED_SHOULD_MATCH = "the jobs that added and those that peeked must be the same";
index 3943af0..e61d57f 100644 (file)
@@ -2,7 +2,6 @@ package vid.automation.test.sections;
 
 import static org.hamcrest.core.Is.is;
 
-import java.util.List;
 import org.junit.Assert;
 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.By;
@@ -15,13 +14,13 @@ import vid.automation.test.infra.SelectOption;
 public class ViewEditPage extends VidBasePage {
     public ViewEditPage selectNodeInstanceToAdd(String vnfName) {
         selectFromDropdownByTestId(Constants.ViewEdit.VNF_OPTION_TEST_ID_PREFIX + vnfName,
-                Constants.ViewEdit.ADD_VNF_BUTTON_TEST_ID);
+            Constants.ViewEdit.ADD_VNF_BUTTON_TEST_ID);
         return this;
     }
 
     public ViewEditPage selectVfModuleToAdd(String vfModuleName) {
         selectFromDropdownByTestId(Constants.ViewEdit.VF_MODULE_OPTION_TEST_ID_PREFIX + vfModuleName,
-                Constants.ViewEdit.ADD_VF_MODULE_BUTTON_TEST_ID);
+            Constants.ViewEdit.ADD_VF_MODULE_BUTTON_TEST_ID);
         return this;
     }
 
@@ -44,7 +43,7 @@ public class ViewEditPage extends VidBasePage {
 
     public ViewEditPage selectVolumeGroupToAdd(String volumeGroupName) {
         selectFromDropdownByTestId(Constants.ViewEdit.VOLUME_GROUP_OPTION_TEST_ID_PREFIX + volumeGroupName,
-                Constants.ViewEdit.ADD_VOLUME_GROUP_BUTTON_TEST_ID);
+            Constants.ViewEdit.ADD_VOLUME_GROUP_BUTTON_TEST_ID);
         return this;
     }
 
@@ -56,7 +55,7 @@ public class ViewEditPage extends VidBasePage {
 
     public ViewEditPage selectNetworkToAdd(String networkName) {
         selectFromDropdownByTestId(Constants.ViewEdit.NETWORK_OPTION_TEST_ID_PREFIX + networkName,
-                Constants.ViewEdit.ADD_NETWORK_BUTTON_TEST_ID);
+            Constants.ViewEdit.ADD_NETWORK_BUTTON_TEST_ID);
         return this;
     }
 
@@ -77,7 +76,7 @@ public class ViewEditPage extends VidBasePage {
 
     public ViewEditPage selectTenant(String tenant){
         SelectOption.byValue(tenant, Constants.ViewEdit.TENANT_SELECT_TESTS_ID);
-       // GeneralUIUtils.clickOnElementByTestId(Constants.ViewEdit.TENANT_SELECT_TESTS_ID, 60);
+        // GeneralUIUtils.clickOnElementByTestId(Constants.ViewEdit.TENANT_SELECT_TESTS_ID, 60);
         return this;
     }
 
@@ -131,8 +130,8 @@ public class ViewEditPage extends VidBasePage {
 //        return this;
 //    }
 
-    public ViewEditPage selectPlatform(List<String> platformList) {
-        SelectOption.selectOptionsFromMultiselectById("multi-selectPlatform", platformList);
+    public ViewEditPage selectPlatform(String platform) {
+        SelectOption.byValue(platform, Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
         return this;
     }
 }
index 74ceec6..8421427 100644 (file)
@@ -357,7 +357,7 @@ public class VidBaseTestCase extends SetupCDTest{
 
         viewEditPage.selectSuppressRollback(suppressRollback);
         if(platform != null){
-            viewEditPage.selectPlatform(ImmutableList.of(platform));
+            viewEditPage.selectPlatform(platform);
         }
         viewEditPage.clickConfirmButton();
         viewEditPage.assertMsoRequestModal(Constants.ViewEdit.MSO_SUCCESSFULLY_TEXT);