summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/test
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-01-01 10:10:27 +0200
committerIttay Stern <ittay.stern@att.com>2020-01-01 10:48:53 +0200
commit42e59f3f3af996a2de92186203d67231c994fa9e (patch)
tree0971120d183fc54e5a06045b9767227734d5c976 /vid-automation/src/test
parentaf5fec242e55ee704c53a739119b712663b88bef (diff)
Add a reference-template with 2 templated Networks: fetch by jobId
Issue-ID: VID-724 Change-Id: Id8906366ebf01ca95045450cb1870fa82f53a3dd Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/test')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
index cf3d508e8..9d84e965d 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
@@ -138,13 +138,12 @@ public class InstantiationTemplatesApiTest extends AsyncInstantiationBase {
String jobId = postAsyncInstanceRequest(request);
- assertThat(fetchRecentTemplateInfo(request.at("/modelInfo/modelVersionId").asText()), allOf(
- jsonPartEquals("jobId", jobId),
+ assertThat(fetchTemplateInfo(request.at("/modelInfo/modelVersionId").asText(), jobId),
jsonPartEquals("requestSummary", ImmutableMap.of(
"vnf", 1L,
"vfModule", 2L,
"volumeGroup", 1L
- ))));
+ )));
}
@Test
@@ -157,8 +156,7 @@ public class InstantiationTemplatesApiTest extends AsyncInstantiationBase {
String jobId = postAsyncInstanceRequest(request);
- assertThat(fetchRecentTemplateInfo(request.at("/modelInfo/modelVersionId").asText()), allOf(
- jsonPartEquals("jobId", jobId),
+ assertThat(fetchTemplateInfo(request.at("/modelInfo/modelVersionId").asText(), jobId), allOf(
jsonEquals(templateInfoFromFile()).when(IGNORING_VALUES), // Assert only field types
jsonEquals(templateInfoFromFile()).whenIgnoringPaths(
// Ignore the fields where values are always changing
@@ -169,8 +167,9 @@ public class InstantiationTemplatesApiTest extends AsyncInstantiationBase {
)));
}
- private JsonNode fetchRecentTemplateInfo(String serviceModelId) {
+ private JsonNode fetchTemplateInfo(String serviceModelId, String jobId) {
return stream(restTemplate.getForObject(getTemplateInfoUrl(serviceModelId), JsonNode[].class))
+ .filter(it -> it.at("/jobId").asText().equals(jobId))
.findFirst()
.orElseGet(() -> {
throw new AssertionError(getTemplateInfoUrl(serviceModelId) + " returned zero results");