summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Sandler <alexey.sandler@intl.att.com>2020-03-15 15:55:10 +0200
committerAmichai Hemli <amichai.hemli@intl.att.com>2020-03-16 10:47:26 +0200
commit212533a0274fd52384c02b929d435e4fb6aeed82 (patch)
treeb26f545f4408b86d3ff9f9130d45b621d64903c1
parent6357b9b66cd937f50a11c223cb63e818ecb9ef08 (diff)
API test to verify simpleNoTaskInfo format
Issue-ID: VID-787 Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com> Change-Id: I650530f9490d45d3fc3fe3fcb1b853bdded7d07a Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java158
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Features.java1
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java20
3 files changed, 179 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java
new file mode 100644
index 000000000..652abbec8
--- /dev/null
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOOrchestrationRequestsGetNoTaskInfoBody.java
@@ -0,0 +1,158 @@
+package org.onap.simulator.presetGenerator.presets.mso;
+
+import static java.util.Collections.singletonList;
+
+import com.google.common.collect.ImmutableMap;
+import java.util.List;
+import java.util.Map;
+import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset;
+import org.springframework.http.HttpMethod;
+
+public class PresetMSOOrchestrationRequestsGetNoTaskInfoBody extends BaseMSOPreset {
+
+ @Override
+ public HttpMethod getReqMethod() {
+ return HttpMethod.GET;
+ }
+
+ @Override
+ public String getReqPath() {
+ return getRootPath() + "/orchestrationRequests/v.";
+ }
+
+ @Override
+ public Map<String, List> getQueryParams() {
+ return ImmutableMap.of(
+ "format", singletonList("simpleNoTaskInfo"),
+ "filter", singletonList("modelType:EQUALS:vnf")
+ );
+ }
+
+ @Override
+ public Object getResponseBody() {
+ return "" +
+ " \"requestList\": ["
+ + " {"
+ + " \"request\": {"
+ + " \"requestId\": \"f01fbb5d-c964-44d4-9080-00e83eae419f\","
+ + " \"startTime\": \"Mon, 05 Aug 2019 12:49:35 GMT\","
+ + " \"finishTime\": \"Mon, 05 Aug 2019 12:50:24 GMT\","
+ + " \"requestScope\": \"vnf\","
+ + " \"requestType\": \"updateInstance\","
+ + " \"requestDetails\": {"
+ + " \"modelInfo\": {"
+ + " \"modelCustomizationName\": \"FEXN_5G_NC_VSP 0\","
+ + " \"modelInvariantId\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\","
+ + " \"modelType\": \"vnf\","
+ + " \"modelName\": \"FEXN_5G_NC_VSP\","
+ + " \"modelVersion\": \"2\","
+ + " \"modelCustomizationUuid\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\","
+ + " \"modelVersionId\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\","
+ + " \"modelCustomizationId\": \"2ba4f9f3-765f-4172-802e-a56a912c221c\","
+ + " \"modelUuid\": \"9ba01811-84ea-4878-9fd7-7a0a280e0572\","
+ + " \"modelInvariantUuid\": \"5fc21c6e-3ca3-4641-90f0-1e2ae66b20be\","
+ + " \"modelInstanceName\": \"FEXN_5G_NC_VSP 0\""
+ + " },"
+ + " \"requestInfo\": {"
+ + " \"productFamilyId\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\","
+ + " \"source\": \"VID\","
+ + " \"instanceName\": \"PST-VNF-1810-None-4751\","
+ + " \"suppressRollback\": false,"
+ + " \"requestorId\": \"yy3692\""
+ + " },"
+ + " \"relatedInstanceList\": ["
+ + " {"
+ + " \"relatedInstance\": {"
+ + " \"instanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\","
+ + " \"modelInfo\": {"
+ + " \"modelInvariantId\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\","
+ + " \"modelType\": \"service\","
+ + " \"modelName\": \"test_VNF_01_by5924\","
+ + " \"modelVersion\": \"2\","
+ + " \"modelVersionId\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\","
+ + " \"modelUuid\": \"6c756dd3-ffa5-4162-b1a8-501e4a643707\","
+ + " \"modelInvariantUuid\": \"abb333ce-c66a-4670-b44a-17fe6a4963f3\""
+ + " }"
+ + " }"
+ + " }"
+ + " ],"
+ + " \"cloudConfiguration\": {"
+ + " \"tenantId\": \"1c099363f335409ea47df3c8db61397a\","
+ + " \"cloudOwner\": \"irma-aic\","
+ + " \"lcpCloudRegionId\": \"mdt19b\""
+ + " },"
+ + " \"requestParameters\": {"
+ + " \"aLaCarte\": true,"
+ + " \"testApi\": \"GR_API\""
+ + " },"
+ + " \"platform\": {"
+ + " \"platformName\": \"None Platform - Collab\""
+ + " },"
+ + " \"lineOfBusiness\": {"
+ + " \"lineOfBusinessName\": \"None_LOB - Collab\""
+ + " }"
+ + " },"
+ + " \"instanceReferences\": {"
+ + " \"serviceInstanceId\": \"a06c0d0b-ae17-42fb-b9b5-4b3a93a7be11\","
+ + " \"vnfInstanceId\": \"569cd880-e095-466a-b97d-97bb46fea257\","
+ + " \"vnfInstanceName\": \"PST-VNF-1810-None-4751\","
+ + " \"requestorId\": \"yy3692\""
+ + " },"
+ + " \"requestStatus\": {"
+ + " \"requestState\": \"ROLLED_BACK\","
+ + " \"statusMessage\": \"STATUS: Error Source: SDNC, Error Message: Unable to find l3-network in AAI for network role sgi_direct_net_2 FLOW STATUS: All Rollback flows have completed successfully ROLLBACK STATUS: Rollback has been completed successfully.\","
+ + " \"percentProgress\": 100,"
+ + " \"timestamp\": \"Mon, 05 Aug 2019 12:50:24 GMT\""
+ + " }"
+ + " }"
+ + " },"
+ + " {"
+ + " \"request\": {"
+ + " \"requestId\": \"64970886-ed75-4837-8bf1-0eb472fe65e6\","
+ + " \"startTime\": \"Fri, 06 Mar 2020 23:07:48 GMT\","
+ + " \"finishTime\": \"Fri, 06 Mar 2020 23:08:40 GMT\","
+ + " \"requestScope\": \"vnf\","
+ + " \"requestType\": \"replaceInstance\","
+ + " \"requestDetails\": {"
+ + " \"modelInfo\": {"
+ + " \"modelCustomizationName\": \"L3VPNvRR-RESOURCE 0\","
+ + " \"modelInvariantId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\","
+ + " \"modelType\": \"vnf\","
+ + " \"modelNameVersionId\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\","
+ + " \"modelName\": \"L3VPNvRR-RESOURCE\","
+ + " \"modelVersion\": \"1\","
+ + " \"modelInvariantUuid\": \"fdb84cd2-87d8-4b22-bf47-b3ef765d2c11\","
+ + " \"modelInstanceName\": \"L3VPNvRR-RESOURCE 0\""
+ + " },"
+ + " \"requestInfo\": {"
+ + " \"source\": \"VID\","
+ + " \"suppressRollback\": false,"
+ + " \"requestorId\": \"ROBOT\""
+ + " },"
+ + " \"cloudConfiguration\": {"
+ + " \"tenantId\": \"78491aac74be4fab9873db114774b475\","
+ + " \"cloudOwner\": \"irma-aic\","
+ + " \"lcpCloudRegionId\": \"dyh2b\""
+ + " },"
+ + " \"requestParameters\": {"
+ + " \"testApi\": \"GR_API\""
+ + " }"
+ + " },"
+ + " \"instanceReferences\": {"
+ + " \"serviceInstanceId\": \"e648ee86-c091-4d38-8573-99893cd79bfa\","
+ + " \"vnfInstanceId\": \"9a2b3dd1-5fd9-4cb4-a47f-b4f0e8e678e3\","
+ + " \"vnfInstanceName\": \"PST-VNF-2002-None-943501\","
+ + " \"requestorId\": \"ROBOT\""
+ + " },"
+ + " \"requestStatus\": {"
+ + " \"requestState\": \"COMPLETE\","
+ + " \"statusMessage\": \"STATUS: ALaCarte-Vnf-deleteInstance request was executed correctly. FLOW STATUS: Successfully completed all Building Blocks\","
+ + " \"percentProgress\": 100,"
+ + " \"timestamp\": \"Fri, 06 Mar 2020 23:08:40 GMT\""
+ + " }"
+ + " }"
+ + " }"
+ + " ]";
+
+ }
+}
diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
index 361ccd70e..8d9765cec 100644
--- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java
+++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
@@ -62,6 +62,7 @@ public enum Features implements Feature {
FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES,
FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF,
FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT,
+ FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD,
FLAG_2006_NETWORK_LOB_MULTI_SELECT,
;
diff --git a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java
index 6625d2a41..6416244aa 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/ChangeManagementApiTest.java
@@ -4,8 +4,11 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
+import static org.onap.vid.api.ChangeManagementUserApiLoggingTest.MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT;
import static org.onap.vid.api.TestUtils.getNestedPropertyInMap;
import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -36,6 +39,7 @@ import org.onap.simulator.presetGenerator.presets.aaf.AAFGetBasicAuthPreset;
import org.onap.simulator.presetGenerator.presets.aaf.AAFGetUrlServicePreset;
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId;
import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
+import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGetNoTaskInfoBody;
import org.onap.simulator.presetGenerator.presets.mso.changeManagement.PresetMsoChangeManagementBase;
import org.onap.simulator.presetGenerator.presets.mso.changeManagement.PresetMsoVnfInPlaceSoftwareUpdate;
import org.onap.simulator.presetGenerator.presets.mso.changeManagement.PresetMsoVnfReplace;
@@ -59,12 +63,15 @@ import org.onap.vid.model.workflow.VnfWorkflowRelationResponse;
import org.onap.vid.model.workflow.WorkflowsDetail;
import org.onap.vid.more.LoggerFormatTest;
import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import org.springframework.web.client.RestTemplate;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+import vid.automation.test.infra.FeatureTogglingTest;
+import vid.automation.test.infra.Features;
import vid.automation.test.services.SimulatorApi;
import vid.automation.test.services.SimulatorApi.RegistrationStrategy;
import vid.automation.test.utils.InsecureHttpsClient;
@@ -85,6 +92,7 @@ public class ChangeManagementApiTest extends BaseApiTest {
public static final String GET_VNF_WORKFLOW_RELATION = "get_vnf_workflow_relation";
public static final String VNF_WORKFLOW_RELATION = "vnf_workflow_relation";
public static final String SCHEDULER_BY_SCHEDULE_ID = "/scheduler/schedules/{scheduleId}";
+ public static final String MSO = "/mso";
@DataProvider
public static Object[][] requestWithoutServiceInstanceId(Method test) {
@@ -291,6 +299,18 @@ public class ChangeManagementApiTest extends BaseApiTest {
System.out.print(stopWatch.prettyPrint());
}
+
+ @Test
+ @FeatureTogglingTest(Features.FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD)
+ public void getOrchestrationForDashboardShouldResponseWithFullBody() {
+ SimulatorApi.registerExpectation(MSO_GET_CHANGE_MANAGEMENTS_SCALEOUT, RegistrationStrategy.CLEAR_THEN_SET);
+ SimulatorApi.registerExpectationFromPreset(new PresetMSOOrchestrationRequestsGetNoTaskInfoBody(), APPEND);
+ ResponseEntity<String> responseEntity = restTemplate.getForEntity(buildUri(CHANGE_MANAGEMENT + MSO ), String.class);
+
+ assertFalse(responseEntity.getBody().contains("requestProcessingData"));
+
+ }
+
// CONFIG_UPDATE
@Test
public void testConfigUpdateHappyPath() throws IOException {