summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket-be')
-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;