From fff70fce14ebe7dec3a4d52b7b90cee4414d0562 Mon Sep 17 00:00:00 2001 From: Pavel Aharoni Date: Tue, 6 Jun 2017 11:48:14 +0300 Subject: [SDC-24] sdnc problems Change-Id: I990126b83b11ae23090bb22bf0a5d46adf71a61a Signed-off-by: Pavel Aharoni --- .../src/main/java/org/openecomp/test/SimpleCallback.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sdc-distribution-ci') diff --git a/sdc-distribution-ci/src/main/java/org/openecomp/test/SimpleCallback.java b/sdc-distribution-ci/src/main/java/org/openecomp/test/SimpleCallback.java index c5cce09..98df4d0 100644 --- a/sdc-distribution-ci/src/main/java/org/openecomp/test/SimpleCallback.java +++ b/sdc-distribution-ci/src/main/java/org/openecomp/test/SimpleCallback.java @@ -277,6 +277,8 @@ public class SimpleCallback implements INotificationCallback { try { List serviceArtifacts = data.getServiceArtifacts(); + List resourcesArtifacts = data.getResources(); + JSONArray jsonData = new JSONArray(new String(payload)); boolean artifactIsFound = true; for (int index = 0 ; index < jsonData.length(); index++) { @@ -285,8 +287,16 @@ public class SimpleCallback implements INotificationCallback { JSONArray artifacts = (JSONArray) jsonObject.get("artifacts"); for (int i = 0 ; i < artifacts.length(); i++) { String artifact = artifacts.getString(i).toString(); + Optional serviceArtifactFound = serviceArtifacts.stream().filter(x -> x.getArtifactUUID().equals(artifact)).findFirst(); - if (!serviceArtifactFound.isPresent()) { + + boolean isResourceFound = false; + for (int j = 0 ; j < resourcesArtifacts.size(); j++) { + Optional resourceArtifactFound = resourcesArtifacts.get(j).getArtifacts().stream().filter(x -> x.getArtifactUUID().equals(artifact)).findFirst(); + isResourceFound = resourceArtifactFound.isPresent() || isResourceFound; + } + + if (!serviceArtifactFound.isPresent() && !isResourceFound) { artifactIsFound = false; System.out.println("################ Artifact: " + artifact + " NOT FOUND in Notification Data ################"); } -- cgit 1.2.3-korg