diff options
author | romaingimbert <romain.gimbert@orange.com> | 2018-04-23 16:15:53 +0200 |
---|---|---|
committer | romaingimbert <romain.gimbert@orange.com> | 2018-04-23 16:15:53 +0200 |
commit | ac288d7c7e1fa60949fe83307a84465b3f488f0c (patch) | |
tree | 9e6d243191db6f124f73a9be9760ec9bdc0c8cee /src/main/java/org/onap | |
parent | 8252e55861286bfea1aa910b6a543cdbdde15808 (diff) |
fix NPE SO Response
-change requestReference to requestReferences
-change mocks
Change-Id: Ia8173b6286d04ab78bd6c5766ad1e9c2c61ab153
Issue-ID: EXTAPI-68
Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReferences.java (renamed from src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReference.java) | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java index bfda46e..590bace 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java @@ -17,13 +17,13 @@ package org.onap.nbi.apis.serviceorder.model.consumer; public class CreateServiceInstanceResponse { - public RequestReference getRequestReference() { - return requestReference; + public RequestReferences getRequestReferences() { + return requestReferences; } - public void setRequestReference(RequestReference requestReference) { - this.requestReference = requestReference; + public void setRequestReferences(RequestReferences requestReferences) { + this.requestReferences = requestReferences; } - private RequestReference requestReference; + private RequestReferences requestReferences; } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReference.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReferences.java index 2d0b7c9..2f74f73 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReference.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/RequestReferences.java @@ -15,7 +15,7 @@ */ package org.onap.nbi.apis.serviceorder.model.consumer; -public class RequestReference { +public class RequestReferences { private String instanceId; @@ -39,6 +39,6 @@ public class RequestReference { @Override public String toString() { - return "RequestReference{" + "instanceId='" + instanceId + '\'' + ", requestId='" + requestId + '\'' + '}'; + return "RequestReferences{" + "instanceId='" + instanceId + '\'' + ", requestId='" + requestId + '\'' + '}'; } } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java index 84a198c..f39ad1f 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskProcessor.java @@ -115,7 +115,7 @@ public class SOTaskProcessor { updateServiceOrderItem(response.getBody(), serviceOrderItem); if (response.getStatusCode() != HttpStatus.CREATED || response.getBody() == null - || response.getBody().getRequestReference() == null) { + || response.getBody().getRequestReferences() == null) { serviceOrderItem.setState(StateType.FAILED); } else { serviceOrderItem.setState(StateType.INPROGRESS); @@ -311,8 +311,8 @@ public class SOTaskProcessor { ServiceOrderItem orderItem) { if (createServiceInstanceResponse != null && !orderItem.getState().equals(StateType.FAILED)) { - orderItem.getService().setId(createServiceInstanceResponse.getRequestReference().getInstanceId()); - orderItem.setRequestId(createServiceInstanceResponse.getRequestReference().getRequestId()); + orderItem.getService().setId(createServiceInstanceResponse.getRequestReferences().getInstanceId()); + orderItem.setRequestId(createServiceInstanceResponse.getRequestReferences().getRequestId()); } } |