diff options
author | Hailong Zhang <zhanghailong22@huawei.com> | 2019-08-31 20:44:21 +0800 |
---|---|---|
committer | Hailong Zhang <zhanghailong22@huawei.com> | 2019-09-02 14:59:27 +0800 |
commit | d810d8d0d5a40cb0801387f27a6b4b2aa890d67a (patch) | |
tree | dc6bfd43a09fa3274eaff3c06a531eaa0441d9a2 /vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution | |
parent | ba8c00de6520f97e72c3a4376cd0e78bba7e0311 (diff) |
modify Sonar Issue
Issue-ID: VNFSDK-462
Signed-off-by: Hailong Zhang <zhanghailong22@huawei.com>
Change-Id: I2faee5b4713506b16315d606ff7119cf47071d31
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution')
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/execution/VTPExecutionResource.java | 11 |
1 files changed, 6 insertions, 5 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 b0cbcad8..40c43c06 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 @@ -70,6 +70,7 @@ import io.swagger.annotations.ApiResponses; @Path("/vtp") @Api(tags = {"VTP Execution"}) public class VTPExecutionResource extends VTPResource{ + private static final String EXECUTION_ID = "exection-id"; public VTPTestExecutionList executeHandler(VTPTestExecutionList executions, String requestId) throws VTPException, IOException { if (requestId == null) { requestId = UUID.randomUUID().toString(); @@ -89,7 +90,7 @@ public class VTPExecutionResource extends VTPResource{ ); String endTime = dateFormatter.format(new Date()); execution.setEndTime(endTime); - execution.setExecutionId(output.getAddonsMap().get("execution-id")); + execution.setExecutionId(output.getAddonsMap().get(EXECUTION_ID)); // set execution status based on success from test. if (output.getSuccess()) { @@ -248,8 +249,8 @@ public class VTPExecutionResource extends VTPResource{ if (n.get("end-time") != null) exec.setEndTime(n.get("end-time").asText()); - if (n.get("execution-id") != null) - exec.setExecutionId(n.get("execution-id").asText()); + if (n.get(EXECUTION_ID) != null) + exec.setExecutionId(n.get(EXECUTION_ID).asText()); if (n.get("request-id") != null) exec.setRequestId(n.get("request-id").asText()); @@ -315,8 +316,8 @@ public class VTPExecutionResource extends VTPResource{ if (result.get("end-time") != null) exec.setEndTime(result.get("end-time").asText()); - if (result.get("execution-id") != null) - exec.setExecutionId(result.get("execution-id").asText()); + if (result.get(EXECUTION_ID) != null) + exec.setExecutionId(result.get(EXECUTION_ID).asText()); if (result.get("request-id") != null) exec.setExecutionId(result.get("request-id").asText()); |