summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/test/java/org
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-11-04 09:07:34 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-11-04 09:07:34 +0200
commit129b3904c875018bea237a3f376a0e1c3ab9a4f9 (patch)
tree1011447b8c80c1719004e1271b852ec1758759f8 /vid-automation/src/test/java/org
parent3a6149664092cacfdf76c0ab985a250ec9131439 (diff)
improve async instantiation log test, to verify all outgoing requests
Issue-ID: VID-253 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: I7717ddd2cbfaec6430b89f88109de8f12f9e9211
Diffstat (limited to 'vid-automation/src/test/java/org')
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest.java13
1 files changed, 6 insertions, 7 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 9b1dc6506..25b40ed6b 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
@@ -1,7 +1,6 @@
package org.onap.vid.api;
import static java.util.Collections.emptyMap;
-import static java.util.stream.Collectors.toList;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -418,9 +417,7 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
deploy1ServiceFromCypress__verifyStatusAndMsoCalls_andRetry("none", emptyMap(), emptyMap(), true);
List<String> logLines = LoggerFormatTest.getLogLinesAsList(LogName.metrics2019, 200, 1, restTemplate, uri);
- List<RecordedRequests> requests = retrieveRecordedRequests();
- List<RecordedRequests> underTestRequests =
- requests.stream().filter(x->x.path.contains(msoURL)).collect(toList());
+ List<RecordedRequests> underTestRequests = retrieveRecordedRequests();
underTestRequests.forEach(request-> {
assertThat("X-ONAP-RequestID", request.headers.get("X-ONAP-RequestID"), contains(matchesPattern(UUID_REGEX)));
@@ -430,14 +427,16 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
});
List<String> allInvocationIds = new LinkedList<>();
- List<String> allRequestsIds = new LinkedList<>();
+ List<String> allMsoRequestsIds = new LinkedList<>();
underTestRequests.forEach(request->{
String invocationId = request.headers.get("X-InvocationID").get(0);
allInvocationIds.add(invocationId);
String requestId = request.headers.get("X-ONAP-RequestID").get(0);
- allRequestsIds.add(requestId);
+ if (request.path.contains(msoURL)) {
+ allMsoRequestsIds.add(requestId);
+ }
assertThat("request id and invocation id must be found in two rows",
logLines,
@@ -459,7 +458,7 @@ public class AsyncInstantiationALaCarteApiTest extends AsyncInstantiationBase {
//make sure no RequestId is repeated twice
assertThat("expect all RequestIds to be unique",
- allRequestsIds, containsInAnyOrder(new HashSet<>(allRequestsIds).toArray()));
+ allMsoRequestsIds, containsInAnyOrder(new HashSet<>(allMsoRequestsIds).toArray()));
}