From 212533a0274fd52384c02b929d435e4fb6aeed82 Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Sun, 15 Mar 2020 15:55:10 +0200 Subject: API test to verify simpleNoTaskInfo format Issue-ID: VID-787 Signed-off-by: Alexey Sandler Change-Id: I650530f9490d45d3fc3fe3fcb1b853bdded7d07a Signed-off-by: Alexey Sandler --- .../org/onap/vid/api/ChangeManagementApiTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vid-automation/src/test/java/org/onap') 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 responseEntity = restTemplate.getForEntity(buildUri(CHANGE_MANAGEMENT + MSO ), String.class); + + assertFalse(responseEntity.getBody().contains("requestProcessingData")); + + } + // CONFIG_UPDATE @Test public void testConfigUpdateHappyPath() throws IOException { -- cgit 1.2.3-korg