diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-08-11 15:10:44 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2023-08-18 10:18:26 +0100 |
commit | cee4b8ae2fc1729d3eec086e0d48e9914fa69006 (patch) | |
tree | bd0279f048ae411e87ce949fbdfcde4cb5a321f2 /participant/participant-impl/participant-impl-http/src/test/java | |
parent | af691618ebd408111c87224e389d27ea8f9bcf46 (diff) |
Upgrade Java 17
Issue-ID: POLICY-4673
Change-Id: Ib09bda7db30f53b01b2ea205ad04e5851217da78
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-http/src/test/java')
3 files changed, 21 insertions, 22 deletions
diff --git a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/rest/ActuatorControllerTest.java b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/rest/ActuatorControllerTest.java index 36c19fa78..f6c0c5a8a 100644..100755 --- a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/rest/ActuatorControllerTest.java +++ b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/rest/ActuatorControllerTest.java @@ -22,20 +22,19 @@ package org.onap.policy.clamp.acm.participant.http.rest; import static org.junit.jupiter.api.Assertions.assertEquals; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.policy.clamp.acm.participant.http.utils.CommonActuatorController; -import org.springframework.boot.test.autoconfigure.actuate.metrics.AutoConfigureMetrics; +import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit.jupiter.SpringExtension; -@AutoConfigureMetrics +@AutoConfigureObservability(tracing = false) @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") @@ -70,22 +69,22 @@ class ActuatorControllerTest extends CommonActuatorController { @Test void testGetHealth() throws Exception { - Invocation.Builder invocationBuilder = super.sendActRequest(HEALTH_ENDPOINT); - Response rawresp = invocationBuilder.buildGet().invoke(); + var invocationBuilder = super.sendActRequest(HEALTH_ENDPOINT); + var rawresp = invocationBuilder.buildGet().invoke(); assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); } @Test void testGetMetrics() throws Exception { - Invocation.Builder invocationBuilder = super.sendActRequest(METRICS_ENDPOINT); - Response rawresp = invocationBuilder.buildGet().invoke(); + var invocationBuilder = super.sendActRequest(METRICS_ENDPOINT); + var rawresp = invocationBuilder.buildGet().invoke(); assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); } @Test void testGePrometheus() throws Exception { - Invocation.Builder invocationBuilder = super.sendActRequest(PROMETHEUS_ENDPOINT); - Response rawresp = invocationBuilder.buildGet().invoke(); + var invocationBuilder = super.sendActRequest(PROMETHEUS_ENDPOINT); + var rawresp = invocationBuilder.buildGet().invoke(); assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus()); } diff --git a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/CommonActuatorController.java b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/CommonActuatorController.java index d6f558d61..0c595d6f2 100644..100755 --- a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/CommonActuatorController.java +++ b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/CommonActuatorController.java @@ -22,12 +22,12 @@ package org.onap.policy.clamp.acm.participant.http.utils; import static org.junit.Assert.assertEquals; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.onap.policy.common.gson.GsonMessageBodyHandler; diff --git a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/MockRestEndpoint.java b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/MockRestEndpoint.java index 037e62986..19ee9603e 100644..100755 --- a/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/MockRestEndpoint.java +++ b/participant/participant-impl/participant-impl-http/src/test/java/org/onap/policy/clamp/acm/participant/http/utils/MockRestEndpoint.java @@ -20,13 +20,13 @@ package org.onap.policy.clamp.acm.participant.http.utils; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Response; import java.util.List; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response; /** * The Class MockRestEndpoint creates rest server endpoints for simulating Rest calls. |