diff options
author | Smokowski, Steven <steve.smokowski@att.com> | 2019-05-31 16:15:23 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-05-31 16:15:37 -0400 |
commit | 96a2da847be40361ff8f0a27875101782fb6b80d (patch) | |
tree | 3d03f22eac888ada9c785b9d9152d54904dfc47c /mso-api-handlers/mso-requests-db/src/main/java | |
parent | 89b396152a7f5ca62175d13342c1b3a1a9067ccb (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/src/main/java')
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) |