From 96a2da847be40361ff8f0a27875101782fb6b80d Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Fri, 31 May 2019 16:15:23 -0400 Subject: 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) --- .../src/main/java/org/onap/so/db/request/beans/InfraRequests.java | 3 ++- .../main/java/org/onap/so/db/request/client/RequestsDbClient.java | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'mso-api-handlers/mso-requests-db/src/main') 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; + private List 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 entity = new HttpEntity<>(requestProcessingData, headers); + restTemplate.put(uri, entity); + } + public List getRequestProcessingDataBySoRequestId(String soRequestId) { return this .getRequestProcessingData(getUri(UriBuilder.fromUri(endpoint + findBySoRequestIdOrderByGroupingIdDesc) -- cgit 1.2.3-korg