summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src
diff options
context:
space:
mode:
authorJames Guistwite <jguistwite@iconectiv.com>2019-05-03 08:26:54 -0400
committerJames Guistwite <jguistwite@iconectiv.com>2019-05-03 10:20:04 -0400
commit07dd70511d455cea91241b11e7e76933cdcbe8f8 (patch)
tree2e659b18b4571967b5ef5e8565febc6274f4f609 /vnfmarket-be/vnf-sdk-marketplace/src
parent51dde1590f590ad5aff7792dc3d49f6bc10a0e93 (diff)
If error returned from test, result was not sent to caller.
Was still an issue when errors was an empty JSON object. Issue-ID: VNFSDK-392 Change-Id: I588789e4bca0ce0933e318a625a54ba04260ce5e Signed-off-by: James Guistwite <jguistwite@iconectiv.com>
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
index e0513360..70ec6e6a 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java
@@ -40,6 +40,7 @@ import javax.ws.rs.core.Response;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.jetty.http.HttpStatus;
import org.glassfish.jersey.media.multipart.BodyPartEntity;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
@@ -100,12 +101,12 @@ public class VTPExecutionResource extends VTPResource{
// tests can fail but still produce results.
ObjectMapper mapper = new ObjectMapper();
Map<String,String> m = output.getAttrsMap();
- if (m.containsKey("results")) {
- execution.setResults(mapper.readTree(m.get("results")));
- }
- else if (m.containsKey("error")) {
+ if ((m.containsKey("error")) && (!StringUtils.equals(m.get("error"), "{}"))) {
execution.setResults(mapper.readTree(m.get("error")));
}
+ else if (m.containsKey("results")) {
+ execution.setResults(mapper.readTree(m.get("results")));
+ }
}
return executions;