diff options
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java')
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java index 97668ed..d6b6c74 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/restclient/OofRestClient.java @@ -96,15 +96,19 @@ public class OofRestClient { } log.info("requestBody{}", requestBody); - String requestUrl = configuration.getOofService() + "/api/oof/pci/v1"; - log.debug("requestUrl {}", requestUrl); + String requestUrl = configuration.getOofService() + configuration.getOofEndpoint(); + log.info("requestUrl {}", requestUrl); ResponseEntity<String> response = null; response = SonHandlerRestTemplate.sendPostRequestToOof(requestUrl, requestBody, new ParameterizedTypeReference<String>() { }); + if (response == null) { throw new OofNotFoundException("Request to oof failed"); } + else if (response.getStatusCodeValue() != 202) { + throw new OofNotFoundException("Request to oof failed with status code" + response.getStatusCodeValue()); + } log.info("response {}", response); return response.getBody(); |