diff options
author | JohnKeeney <john.keeney@est.tech> | 2023-03-01 19:04:58 +0000 |
---|---|---|
committer | JohnKeeney <john.keeney@est.tech> | 2023-03-01 19:12:17 +0000 |
commit | 62abcd8a852595e8d2e32154708f962a8fa8d4a2 (patch) | |
tree | 3c30d9634aee9486bec2364100fe45a2355062ea /a1-policy-management/src/main | |
parent | 1c317ebe1323f5f749adad062ec3486612ef7a25 (diff) |
Update to JDK 17 & Springboot 3
Issue-ID: CCSDK-3858
Change-Id: I3b0f9b391590684b222494bd648328626a3f9efb
Signed-off-by: JohnKeeney <john.keeney@est.tech>
Diffstat (limited to 'a1-policy-management/src/main')
2 files changed, 6 insertions, 4 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java index 6bc5a6dd..f3f57067 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java @@ -33,6 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import reactor.core.publisher.Mono; @@ -86,15 +87,15 @@ public class ErrorResponse { this.message = message; } - static Mono<ResponseEntity<Object>> createMono(String text, HttpStatus code) { + static Mono<ResponseEntity<Object>> createMono(String text, HttpStatusCode code) { return Mono.just(create(text, code)); } - static Mono<ResponseEntity<Object>> createMono(Exception e, HttpStatus code) { + static Mono<ResponseEntity<Object>> createMono(Exception e, HttpStatusCode code) { return createMono(e.toString(), code); } - static ResponseEntity<Object> create(String text, HttpStatus code) { + static ResponseEntity<Object> create(String text, HttpStatusCode code) { logger.debug("Error response: {}, {}", code, text); ErrorInfo p = new ErrorInfo(text, code.value()); String json = gson.toJson(p); @@ -103,7 +104,7 @@ public class ErrorResponse { return new ResponseEntity<>(json, headers, code); } - public static ResponseEntity<Object> create(Throwable e, HttpStatus code) { + public static ResponseEntity<Object> create(Throwable e, HttpStatusCode code) { if (e instanceof RuntimeException) { code = HttpStatus.INTERNAL_SERVER_ERROR; } else if (e instanceof ServiceException) { diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java index 500ddd2a..f5950c9b 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java @@ -57,6 +57,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; |