From ba40eeb0df65eba18fa150c8736f6cc084508d4b Mon Sep 17 00:00:00 2001 From: "Plummer, Brittany" Date: Wed, 20 Nov 2019 20:56:44 -0500 Subject: vnf and vf module replace requests to make Added cloudConfiguration when not sent in replace request Added robot test for vfModule request with no cloud config Started adding unit tests for ServiceInstances Added unit tests for BpmnRequestBuilder changes Added ServiceInstances tests to test replace without CloudConfig Removed unused wiremock stubbings from test Added check for replaceInstanceRetainAssignments action Added action to common package to fix failing robot tests Removed new test, updated existing vfModule replace Added jackson annotations to RequestError object Fixed failing unit tests apih common Issue-ID: SO-2523 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I9470a0a9c7e356ef98ceb7269e066e79e0afb074 --- .../java/org/onap/so/serviceinstancebeans/RequestError.java | 11 +++++++++-- .../org/onap/so/serviceinstancebeans/ServiceException.java | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'common/src') diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java index 121fd4a1a5..33678b336f 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestError.java @@ -33,7 +33,12 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.builder.ToStringBuilder; -import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.As; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import com.fasterxml.jackson.annotation.JsonTypeName; /** @@ -63,7 +68,9 @@ import com.fasterxml.jackson.annotation.JsonRootName; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"policyException", "serviceException"}) @XmlRootElement(name = "requestError") -@JsonRootName(value = "requestError") +@JsonTypeName("requestError") +@JsonTypeInfo(include = As.WRAPPER_OBJECT, use = Id.NAME) +@JsonInclude(Include.NON_NULL) public class RequestError { protected PolicyException policyException; diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java index f2976136e9..cbbc7f61c1 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/ServiceException.java @@ -31,6 +31,8 @@ package org.onap.so.serviceinstancebeans; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonRootName; @@ -55,6 +57,7 @@ import com.fasterxml.jackson.annotation.JsonRootName; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "serviceException") @JsonRootName(value = "serviceException") +@JsonInclude(Include.NON_EMPTY) public class ServiceException extends ExceptionType { -- cgit 1.2.3-korg