aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthieu Geerebaert <matthieu.geerebaert@orange.com>2018-04-23 14:48:49 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-23 14:48:49 +0000
commit3d944291d69d104f3ea9a2d5b66768967cefaafa (patch)
tree4615c8d2f8de92aba28b32dde10b0fbf1e0d2365 /src
parent975ff3cd3064999726c3e8a46d0e8cc8d8795243 (diff)
parentac288d7c7e1fa60949fe83307a84465b3f488f0c (diff)
Merge "fix NPE SO Response"
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/model/consumer/CreateServiceInstanceResponse.java10
-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.java6
-rw-r--r--src/test/resources/mappings/so_delete_service_instance.json2
-rw-r--r--src/test/resources/mappings/so_post_create_service_instance.json2
5 files changed, 12 insertions, 12 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 94d5553..1d1ef36 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
@@ -103,7 +103,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);
@@ -301,8 +301,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());
}
}
diff --git a/src/test/resources/mappings/so_delete_service_instance.json b/src/test/resources/mappings/so_delete_service_instance.json
index fae7b9e..d89c184 100644
--- a/src/test/resources/mappings/so_delete_service_instance.json
+++ b/src/test/resources/mappings/so_delete_service_instance.json
@@ -9,7 +9,7 @@
"Content-Type": "application/json"
},
"jsonBody": {
- "requestReference": {
+ "requestReferences": {
"instanceId": "instanceId",
"requestId": "requestId"
}
diff --git a/src/test/resources/mappings/so_post_create_service_instance.json b/src/test/resources/mappings/so_post_create_service_instance.json
index 239aecb..f5aaa90 100644
--- a/src/test/resources/mappings/so_post_create_service_instance.json
+++ b/src/test/resources/mappings/so_post_create_service_instance.json
@@ -9,7 +9,7 @@
"Content-Type": "application/json"
},
"jsonBody": {
- "requestReference": {
+ "requestReferences": {
"instanceId": "instanceId",
"requestId": "requestId"
}