summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-05-31 16:15:23 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-05-31 16:15:37 -0400
commit96a2da847be40361ff8f0a27875101782fb6b80d (patch)
tree3d03f22eac888ada9c785b9d9152d54904dfc47c /mso-api-handlers/mso-requests-db
parent89b396152a7f5ca62175d13342c1b3a1a9067ccb (diff)
Fix issue where request was not being updated
Fix issue where request was not being updated Change-Id: Ib4b3809797449224ac417facfaa4bf48d91a1ecb Issue-ID: SO-1966 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java3
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java7
2 files changed, 9 insertions, 1 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
index 1a925f2531..5b40e40eb9 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
@@ -22,6 +22,7 @@ package org.onap.so.db.request.beans;
import java.net.URI;
import java.sql.Timestamp;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -157,7 +158,7 @@ public abstract class InfraRequests implements java.io.Serializable {
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "SO_REQUEST_ID", referencedColumnName = "REQUEST_ID")
- private List<CloudApiRequests> cloudApiRequests;
+ private List<CloudApiRequests> cloudApiRequests = new ArrayList<>();
@ResourceId
public URI getRequestURI() {
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
index ca2f52690c..1867b85de6 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
@@ -338,6 +338,13 @@ public class RequestsDbClient {
restTemplate.postForLocation(uri, entity);
}
+ public void updateRequestProcessingData(RequestProcessingData requestProcessingData) {
+ HttpHeaders headers = getHttpHeaders();
+ URI uri = getUri(requestProcessingDataURI);
+ HttpEntity<RequestProcessingData> entity = new HttpEntity<>(requestProcessingData, headers);
+ restTemplate.put(uri, entity);
+ }
+
public List<RequestProcessingData> getRequestProcessingDataBySoRequestId(String soRequestId) {
return this
.getRequestProcessingData(getUri(UriBuilder.fromUri(endpoint + findBySoRequestIdOrderByGroupingIdDesc)