aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/test/java
diff options
context:
space:
mode:
authorSara Weiss <sara.weiss@intl.att.com>2019-12-02 09:05:58 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-12-02 07:58:15 +0000
commit48f350fa03ff2a0f65584575d4955a46ddf16898 (patch)
treee10c77dcfab04a53014a7eba26be327dd1e8dddf /vid-automation/src/test/java
parente8887222c45e7d1849cb8098997c8fb7c149ebd7 (diff)
Add query param option for filtering services info by service model id
Issue-ID: VID-724 Signed-off-by: Sara Weiss <sara.weiss@intl.att.com> Change-Id: I72c78dd3c0e156688092ce4ac3793bc3e8c37352
Diffstat (limited to 'vid-automation/src/test/java')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java25
1 files changed, 25 insertions, 0 deletions
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 8fe0580aa..78257b398 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
@@ -2,6 +2,7 @@ package org.onap.vid.api;
import static java.util.Collections.emptyMap;
import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toSet;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -50,6 +51,9 @@ import org.onap.vid.model.asyncInstantiation.JobAuditStatus.SourceStatus;
import org.onap.vid.model.asyncInstantiation.ServiceInfo;
import org.onap.vid.more.LoggerFormatTest;
import org.onap.vid.more.LoggerFormatTest.LogName;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -122,6 +126,27 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
}
@Test
+ public void deployTwoServicesGetServicesFilterByModelId() {
+ final ImmutableMap<PresetMSOServiceInstanceGen2WithNames.Keys, String> names = ImmutableMap
+ .of(SERVICE_NAME, "calazixide85");
+
+ final List<String> uuids1 = createBulkOfInstances(false, 2, names, CREATE_BULK_OF_ALACARTE_REQUEST);
+ final List<String> uuids2 = createBulkOfInstances(false, 1, names, DELETE_BULK_OF_ALACARTE_REQUEST);
+
+ String SERVICE_MODEL_UUID = "e3c34d88-a216-4f1d-a782-9af9f9588705";
+ ResponseEntity<List<ServiceInfo>> response = restTemplate.exchange(
+ getServiceInfoUrl() + "?serviceModelId=" + SERVICE_MODEL_UUID,
+ HttpMethod.GET,
+ null,
+ new ParameterizedTypeReference<List<ServiceInfo>>() {
+ });
+ assertThat(response.getBody().stream().map(x -> x.serviceModelId).collect(toSet()),
+ contains(SERVICE_MODEL_UUID));
+
+ }
+
+
+ @Test
public void deleteServiceWithTwoVnfGroups_andRetry() {
String parentServiceInstanceId = "service-instance-id";
String firstVnfGroupToDeleteInstanceId = "VNF_GROUP1_INSTANCE_ID";