diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-11-15 14:13:45 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-11-15 14:13:45 +0530 |
commit | 4d09555dafdda0c80a3db07ae65a376e384321e2 (patch) | |
tree | c25b16979be154f33901beba2b2016ce9c208d8f /vnfmarket-be/vnf-sdk-marketplace/src | |
parent | 3ffaebda4e63fedde87f6a95eabdb71ec087bd3f (diff) |
Add build-tag in test result
Issue-ID: VNFSDK-334
Change-Id: Iaff5c9459f47397721eea971c087e1d3e0d5a7be
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src')
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/VTPResource.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/VTPResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/VTPResource.java index 6c8b127f..685e0090 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/VTPResource.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/VTPResource.java @@ -39,6 +39,9 @@ import org.onap.vnfsdk.marketplace.db.exception.MarketplaceResourceException; import org.open.infc.grpc.Result; import org.open.infc.grpc.client.OpenRemoteCli; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.gson.internal.LinkedTreeMap; import io.swagger.annotations.Api; @@ -106,6 +109,11 @@ public class VTPResource { return Response.serverError().entity(result.getOutput()).build(); } - return Response.ok(result.getOutput(), MediaType.APPLICATION_JSON).build(); + ObjectMapper mapper = new ObjectMapper(); + JsonNode resultJson = mapper.readTree(result.getOutput()); + + ((ObjectNode)resultJson).put("build_tag", System.getenv("BUILD_TAG")); + + return Response.ok(resultJson.toString(), MediaType.APPLICATION_JSON).build(); } } |