diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-08-11 15:10:44 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-09-25 13:40:52 +0100 |
commit | 4407ea6948a060734a4f2836b11bd2d5c6ea6194 (patch) | |
tree | 6a6e482126ec3d8e830faf80a392b2161ced6de0 /participant/participant-impl/participant-impl-simulator/src | |
parent | c4b3c527882610afc3f08c0efd73e2f7841e9fe5 (diff) |
Upgrade Java 17
Issue-ID: POLICY-4673
Change-Id: I01fd3677687b5d2e065d0cc131b338ed841d7e99
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-simulator/src')
6 files changed, 26 insertions, 27 deletions
diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/config/SecurityConfig.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/config/SecurityConfig.java index f15491c4d..9b6dc64a8 100644 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/config/SecurityConfig.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/config/SecurityConfig.java @@ -22,7 +22,9 @@ package org.onap.policy.clamp.acm.participant.sim.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.web.SecurityFilterChain; /** @@ -39,11 +41,9 @@ public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http - .httpBasic() - .and() - .authorizeHttpRequests().anyRequest().authenticated() - .and() - .csrf().disable(); + .httpBasic(Customizer.withDefaults()) + .authorizeHttpRequests(authorize -> authorize.anyRequest().authenticated()) + .csrf(AbstractHttpConfigurer::disable); return http.build(); } } diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParameters.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParameters.java index b67a1ca6c..4c7845143 100644..100755 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParameters.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParameters.java @@ -20,8 +20,8 @@ package org.onap.policy.clamp.acm.participant.sim.parameters; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.onap.policy.clamp.acm.participant.intermediary.parameters.ParticipantIntermediaryParameters; diff --git a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/rest/SimulatorController.java b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/rest/SimulatorController.java index db828414d..445a2a111 100755 --- a/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/rest/SimulatorController.java +++ b/participant/participant-impl/participant-impl-simulator/src/main/java/org/onap/policy/clamp/acm/participant/sim/rest/SimulatorController.java @@ -20,9 +20,9 @@ package org.onap.policy.clamp.acm.participant.sim.rest; +import jakarta.validation.Valid; +import jakarta.ws.rs.core.MediaType; import java.util.UUID; -import javax.validation.Valid; -import javax.ws.rs.core.MediaType; import lombok.RequiredArgsConstructor; import org.onap.policy.clamp.acm.participant.sim.controller.genapi.SimulatorParticipantControllerApi; import org.onap.policy.clamp.acm.participant.sim.main.handler.AutomationCompositionElementHandler; diff --git a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParametersTest.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParametersTest.java index 7e5df4c89..0f6e2d45b 100644..100755 --- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParametersTest.java +++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/parameters/ParticipantSimParametersTest.java @@ -22,8 +22,8 @@ package org.onap.policy.clamp.acm.participant.sim.parameters; import static org.assertj.core.api.Assertions.assertThat; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; import org.junit.jupiter.api.Test; import org.onap.policy.clamp.acm.participant.sim.comm.CommonTestData; diff --git a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/rest/ActuatorControllerTest.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/rest/ActuatorControllerTest.java index 474d45cc5..08557f56d 100644..100755 --- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/rest/ActuatorControllerTest.java +++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/rest/ActuatorControllerTest.java @@ -22,20 +22,19 @@ package org.onap.policy.clamp.acm.participant.sim.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.sim.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-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/utils/CommonActuatorController.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/utils/CommonActuatorController.java index 846e76349..b5e2ff618 100644..100755 --- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/utils/CommonActuatorController.java +++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/acm/participant/sim/utils/CommonActuatorController.java @@ -22,12 +22,12 @@ package org.onap.policy.clamp.acm.participant.sim.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; |