summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2019-04-26 14:39:55 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2019-04-26 15:19:57 +0530
commit0bb58cfbe91dd7b77178f775df16d873131eb1ef (patch)
tree9fccc081d5aee0b4ac9ecde1553cdf812aa05cc3
parent0164ebaeecf27e635b3b4097034780dbb8be7c74 (diff)
Removed JsonIgnore for resourceInput
Removed JsonIgnore for resourceinput, it was earlier made @jsonIgnore to fix mapping (SO-1358). Change-Id: I7eb7160be220d445bec396d4c5eb3fd913e66f9e Issue-ID: SO-1816 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java3
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java13
2 files changed, 15 insertions, 1 deletions
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java
index f66ad36058..a69a49b89a 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java
@@ -32,6 +32,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
* Encapsulates VNF resource data set
*
*/
+@JsonIgnoreProperties(ignoreUnknown = true)
@JsonRootName("vnfResource")
public class VnfResource extends Resource {
@@ -59,7 +60,7 @@ public class VnfResource extends Resource {
private String multiStageDesign;
private String orchestrationStatus;
- @JsonIgnore
+ @JsonProperty("resourceInput")
private String resourceInput;
/*
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
index 09bcfe8470..b23633b4d8 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java
@@ -58,6 +58,19 @@ public class VnfResourceTest {
VnfResource vnfResource = objectMapper.readValue(jsonStr, VnfResource.class);
assertTrue(vnfResource != null);
+ assertEquals("sample", vnfResource.getResourceInput());
+ assertEquals("home", vnfResource.getVnfHostname());
+ }
+
+ @Test
+ public void vnfResourceMapperTestNoResourceInput() throws IOException {
+ String jsonStr = "{\"vnfHostname\": \"home\"}";
+ ObjectMapper objectMapper = new ObjectMapper();
+ VnfResource vnfResource = objectMapper.readValue(jsonStr, VnfResource.class);
+
+ assertTrue(vnfResource != null);
+ assertEquals(null, vnfResource.getResourceInput());
+ assertEquals("home", vnfResource.getVnfHostname());
}
@Test