From 62abcd8a852595e8d2e32154708f962a8fa8d4a2 Mon Sep 17 00:00:00 2001 From: JohnKeeney Date: Wed, 1 Mar 2023 19:04:58 +0000 Subject: Update to JDK 17 & Springboot 3 Issue-ID: CCSDK-3858 Change-Id: I3b0f9b391590684b222494bd648328626a3f9efb Signed-off-by: JohnKeeney --- .../a1policymanagementservice/controllers/v2/ErrorResponse.java | 9 +++++---- .../controllers/v2/PolicyController.java | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'a1-policy-management/src/main') 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> createMono(String text, HttpStatus code) { + static Mono> createMono(String text, HttpStatusCode code) { return Mono.just(create(text, code)); } - static Mono> createMono(Exception e, HttpStatus code) { + static Mono> createMono(Exception e, HttpStatusCode code) { return createMono(e.toString(), code); } - static ResponseEntity create(String text, HttpStatus code) { + static ResponseEntity 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 create(Throwable e, HttpStatus code) { + public static ResponseEntity 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; -- cgit 1.2.3-korg