aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2020-12-21 11:06:35 +0000
committerGerrit Code Review <gerrit@onap.org>2020-12-21 11:06:35 +0000
commit3518025420e53b0257945ba7a0e1fd9925f8c25f (patch)
treec8fe96e332729c04c1a6d881f5e2281a76388c07 /bpmn
parent63dcede0648aeed18c64d9947eb6fa02865e6c32 (diff)
parente837f1ac45ddbe769567ee44ba2c22f533ad4977 (diff)
Merge "Fix healthcheck preload"
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java17
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java5
2 files changed, 15 insertions, 7 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 d966528f6c..c18680afae 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
@@ -20,23 +20,24 @@
package org.onap.so.bpmn.appc.payload;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Optional;
+import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersDistributeTraffic;
+import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersHealthCheck;
import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersQuiesce;
import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersResumeTraffic;
-import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersDistributeTraffic;
import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersUpgrade;
+import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficAction;
+import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficCheckAction;
import org.onap.so.bpmn.appc.payload.beans.HealthCheckAction;
import org.onap.so.bpmn.appc.payload.beans.QuiesceTrafficAction;
import org.onap.so.bpmn.appc.payload.beans.RequestParametersHealthCheck;
import org.onap.so.bpmn.appc.payload.beans.ResumeTrafficAction;
-import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficAction;
-import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficCheckAction;
import org.onap.so.bpmn.appc.payload.beans.SnapshotAction;
import org.onap.so.bpmn.appc.payload.beans.StartStopAction;
import org.onap.so.bpmn.appc.payload.beans.UpgradeAction;
import org.onap.so.bpmn.core.json.JsonUtils;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
public class PayloadClient {
@@ -122,6 +123,12 @@ public class PayloadClient {
RequestParametersHealthCheck requestParams = new RequestParametersHealthCheck();
requestParams.setHostIpAddress(vnfHostIpAddress);
payloadResult.setRequestParameters(requestParams);
+
+ ConfigurationParametersHealthCheck configurationParametersHealthCheck =
+ new ConfigurationParametersHealthCheck();
+ configurationParametersHealthCheck.setVnfName(vnfName);
+ payloadResult.setConfigurationParameters(configurationParametersHealthCheck);
+
return Optional.of((mapper.writeValueAsString(payloadResult)));
}
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 2ecf741869..2e16572069 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
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP - SO
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,7 +66,8 @@ public class PayloadClientTest {
@Test
public void healthCheckFormatTest() throws Exception {
- String payloadResult = "{\"request-parameters\":{\"host-ip-address\":\"hostIpAddress1\"}}";
+ String payloadResult =
+ "{\"request-parameters\":{\"host-ip-address\":\"hostIpAddress1\"},\"configuration-parameters\":{\"vnf_name\":\"vnfName1\"}}";
Optional<String> payloadClient = PayloadClient.healthCheckFormat("vnfName1", "hostIpAddress1");
assertEquals(payloadResult, payloadClient.get());
}