diff options
-rw-r--r-- | bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/VnfResource.java | 3 | ||||
-rw-r--r-- | bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/domain/VnfResourceTest.java | 13 |
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 |