diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-07-27 10:12:59 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-08-10 09:47:49 +0100 |
commit | b126aa0bc7c37eeaeeb22c054507aa98e7a5af20 (patch) | |
tree | f0ba06f0e1ed00828cfa32d8df29d8f0cc5aa8dd /models-errors | |
parent | 7ef097fb909c69c43e0d8b4387e59640c4ddaf82 (diff) |
Java 17 Upgrade
Issue-ID: POLICY-4669
Change-Id: I2a57a8366d3956a172a94c81ab950af179d4767b
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'models-errors')
3 files changed, 14 insertions, 16 deletions
diff --git a/models-errors/pom.xml b/models-errors/pom.xml index 3d951c0bb..03d573ada 100644 --- a/models-errors/pom.xml +++ b/models-errors/pom.xml @@ -1,6 +1,6 @@ <!-- ============LICENSE_START======================================================= - Copyright (C) 2019 Nordix Foundation. + Copyright (C) 2019, 2023 Nordix Foundation. Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,10 +38,5 @@ <artifactId>gson</artifactId> <version>${policy.common.version}</version> </dependency> - <dependency> - <groupId>com.openpojo</groupId> - <artifactId>openpojo</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponse.java b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponse.java index 1f1fc0e5d..b06037e9b 100644 --- a/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponse.java +++ b/models-errors/src/main/java/org/onap/policy/models/errors/concepts/ErrorResponse.java @@ -3,6 +3,7 @@ * ONAP Policy Decision Models * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,9 +22,10 @@ package org.onap.policy.models.errors.concepts; import com.google.gson.annotations.SerializedName; +import jakarta.ws.rs.core.Response; +import java.io.Serial; import java.io.Serializable; import java.util.List; -import javax.ws.rs.core.Response; import lombok.Data; /** @@ -31,19 +33,19 @@ import lombok.Data; * response from API calls in the Policy Framework. * * @author pameladragosh - * */ @Data public class ErrorResponse implements Serializable { + @Serial private static final long serialVersionUID = 6760066094588944729L; @SerializedName("code") - private Response.Status responseCode; + private Response.Status responseCode; @SerializedName("error") - private String errorMessage; + private String errorMessage; @SerializedName("details") - private List<String> errorDetails; + private List<String> errorDetails; @SerializedName("warnings") - private List<String> warningDetails; + private List<String> warningDetails; } diff --git a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java index 1373cce47..0be37f489 100644 --- a/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java +++ b/models-errors/src/test/java/org/onap/policy/models/errors/concepts/ErrorResponseTest.java @@ -3,6 +3,7 @@ * ONAP Policy Decision Models * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +24,8 @@ package org.onap.policy.models.errors.concepts; import static org.assertj.core.api.Assertions.assertThatCode; import static org.junit.Assert.assertEquals; -import java.util.Arrays; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; +import java.util.List; import org.junit.Test; import org.onap.policy.common.utils.coder.StandardCoder; import org.slf4j.Logger; @@ -42,9 +43,9 @@ public class ErrorResponseTest { error.setResponseCode(Response.Status.NOT_ACCEPTABLE); error.setErrorMessage("Missing metadata section"); - error.setErrorDetails(Arrays.asList("You must have a metadata section with policy-id value")); + error.setErrorDetails(List.of("You must have a metadata section with policy-id value")); - error.setWarningDetails(Arrays.asList("Please make sure topology template field is included.")); + error.setWarningDetails(List.of("Please make sure topology template field is included.")); StandardCoder coder = new StandardCoder(); String jsonOutput = coder.encode(error); |