From 89de17b50dcd1d29fb87acfe518d1ddf43c1408a Mon Sep 17 00:00:00 2001 From: Yoav Schneiderman Date: Wed, 18 Dec 2019 21:04:38 +0200 Subject: move templates API to a intended controller Issue-ID: VID-730 Change-Id: Id2aa44803a190333b5a96fda77ca15d254b4c222 Signed-off-by: Einat Vinouze --- .../src/main/java/org/onap/vid/api/AsyncInstantiationBase.java | 4 ++++ .../java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'vid-automation/src') diff --git a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java index 5e1310535..8855b51f0 100644 --- a/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java +++ b/vid-automation/src/main/java/org/onap/vid/api/AsyncInstantiationBase.java @@ -105,6 +105,10 @@ public class AsyncInstantiationBase extends BaseMsoApiTest { return uri.toASCIIString() + "/asyncInstantiation"; } + protected String getTemplateInfoUrl(String serviceModelId) { + return uri.toASCIIString() + "/instantiationTemplates?serviceModelId=" + serviceModelId; + } + protected String getJobAuditUrl() { return uri.toASCIIString() + "/asyncInstantiation/auditStatus/{JOB_ID}?source={SOURCE}"; } diff --git a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java index ff30c9ce5..4d2f06983 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java @@ -16,6 +16,7 @@ import static org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPres import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost.DEFAULT_REQUEST_ID; import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPreset; import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; import static vid.automation.test.services.SimulatorApi.retrieveRecordedRequests; @@ -31,6 +32,7 @@ import java.util.stream.Stream; import org.onap.simulator.presetGenerator.presets.BasePresets.BaseMSOPreset; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOAddOrRemoveOneInstanceGroupMember; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOAddOrRemoveOneInstanceGroupMember.InstanceGroupMemberAction; import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; @@ -129,6 +131,8 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase { @Test public void deployTwoServicesGetServicesFilterByModelId() { + registerExpectationFromPreset(new PresetAAIGetSubscribersGet(), RegistrationStrategy.CLEAR_THEN_SET); + List uuids = new LinkedList<>(); try { //given @@ -145,7 +149,7 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase { //when ResponseEntity> response = restTemplate.exchange( - getServiceInfoUrl() + "?serviceModelId=" + SERVICE_MODEL_UUID, + getTemplateInfoUrl(SERVICE_MODEL_UUID), HttpMethod.GET, null, new ParameterizedTypeReference>() { @@ -169,8 +173,6 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase { uuids.forEach(uuid->new AsyncJobsService().muteAsyncJobById(uuid)); } } - - @Test public void deleteServiceWithTwoVnfGroups_andRetry() { String parentServiceInstanceId = "service-instance-id"; -- cgit 1.2.3-korg