diff options
author | Rob Daugherty <rd472p@att.com> | 2018-09-12 20:17:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-09-12 20:17:55 +0000 |
commit | a27835eb54e664194be5978d267e269ee2895260 (patch) | |
tree | e7e4374d37e524415a6de3ffb4c672b452787f71 /bpmn/MSOCommonBPMN | |
parent | 4bcb139985525cd91a556794179f7faa53bf3938 (diff) | |
parent | 5a3663bda14603109c1e51670a29bf783195ab21 (diff) |
Merge "Update GenericHealthCheck to send vnfHostIpAddress"
Diffstat (limited to 'bpmn/MSOCommonBPMN')
3 files changed, 17 insertions, 9 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java index ca1acc5963..47e36424dd 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java @@ -85,12 +85,9 @@ public class PayloadClient { public static Optional<String> healthCheckFormat(String vnfName, String vnfHostIpAddress) throws JsonProcessingException{ HealthCheckAction payloadResult = new HealthCheckAction(); RequestParametersHealthCheck requestParams = new RequestParametersHealthCheck(); - ConfigurationParametersHealthCheck configParams = new ConfigurationParametersHealthCheck(); - requestParams.setVnfName(vnfName); - configParams.setVnfName(vnfName); - payloadResult.setConfigurationParameters(configParams); + requestParams.setVnfHostIpAddress(vnfHostIpAddress); payloadResult.setRequestParameters(requestParams); - return Optional.of(mapper.writeValueAsString(payloadResult)); + return Optional.of((mapper.writeValueAsString(payloadResult)).replaceAll("\"", "\\\\\"")); } public static Optional<String> snapshotFormat(String vmId, String identityUrl)throws JsonProcessingException{ diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/beans/RequestParametersHealthCheck.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/beans/RequestParametersHealthCheck.java index ca87ad6d15..053ac5e741 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/beans/RequestParametersHealthCheck.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/beans/RequestParametersHealthCheck.java @@ -32,16 +32,27 @@ public class RequestParametersHealthCheck { @JsonProperty("vnf-name") private String vnfName; - +@JsonProperty("vnf-host-ip-address") +private String vnfHostIpAddress; @JsonProperty("vnf-name") public String getVnfName() { -return vnfName; + return vnfName; } @JsonProperty("vnf-name") public void setVnfName(String vnfName) { -this.vnfName = vnfName; + this.vnfName = vnfName; +} + +@JsonProperty("vnf-host-ip-address") +public void setVnfHostIpAddress(String vnfHostIpAddress) { + this.vnfHostIpAddress = vnfHostIpAddress; +} + +@JsonProperty("vnf-host-ip-address") +public String getVnfHostIpAddress() { + return vnfHostIpAddress; } } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java index 80b978e4fd..a08d8ca25d 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java @@ -66,7 +66,7 @@ public class PayloadClientTest { @Test public void healthCheckFormatTest() throws Exception { - String payloadResult = "{\"request-parameters\":{\"vnf-name\":\"vnfName1\"},\"configuration-parameters\":{\"vnf_name\":\"vnfName1\"}}"; + String payloadResult = "{\\\"request-parameters\\\":{\\\"vnf-host-ip-address\\\":\\\"vnfHostIpAddress1\\\"}}"; Optional<String> payloadClient = PayloadClient.healthCheckFormat("vnfName1", "vnfHostIpAddress1"); assertEquals(payloadResult, payloadClient.get()); } |