From 8b23e17c538b3909569fb6628731ee915658879e Mon Sep 17 00:00:00 2001 From: stigus Date: Thu, 11 Jan 2024 17:02:26 +0100 Subject: [PATCH] Update tps-messaging-service til spring 3.2 #deploy-tps-messaging-service --- apps/budpro-service/build.gradle | 12 +++++- .../ResourceNumberGenerator.java | 2 +- .../budpro/generate/BudproControllerTest.java | 10 ++--- .../config/SecurityConfig.java | 38 +++++++++---------- .../config/SecurityConfig.java | 11 +++--- apps/tps-messaging-service/build.gradle | 25 +++++++----- .../config/XmlMapperConfig.java | 26 ------------- .../consumer/EndringsmeldingConsumer.java | 6 +-- .../consumer/ServicerutineConsumer.java | 6 +-- .../consumer/TpsConsumer.java | 2 +- .../consumer/command/TpsMeldingCommand.java | 4 +- .../dto/BankkontoNorskRequest.java | 4 +- .../dto/BankkontoNorskResponse.java | 2 +- .../dto/BankkontoUtlandRequest.java | 4 +- .../dto/BankkontoUtlandResponse.java | 2 +- .../dto/EgenansattRequest.java | 4 +- .../dto/EgenansattResponse.java | 2 +- .../dto/KontaktopplysningerRequest.java | 4 +- .../dto/KontaktopplysningerResponse.java | 2 +- .../dto/SfePersonDataErrorResponse.java | 2 +- .../dto/SikkerhetstiltakRequest.java | 4 +- .../dto/SikkerhetstiltakResponse.java | 2 +- .../dto/SpraakRequest.java | 4 +- .../dto/SpraakResponse.java | 2 +- .../dto/TpsEndringsopplysninger.java | 2 +- .../dto/TpsPersonDataErrorResponse.java | 2 +- .../dto/TpsServiceRutine.java | 2 +- .../dto/TpsServicerutineM201Response.java | 4 +- .../dto/TpsServicerutineRequest.java | 2 +- .../dto/TpsSystemInfo.java | 2 +- .../CachedConnectionFactoryFactory.java | 2 +- .../mapper/AdresseMappingStrategy.java | 3 +- .../BankkontonrNorskMappingStrategy.java | 3 +- .../service/BankkontoNorskService.java | 4 +- .../service/BankkontoUtlandService.java | 4 +- .../service/EgenansattService.java | 4 +- .../service/IdentService.java | 14 +++---- .../service/PersonService.java | 4 +- .../service/SikkerhetstiltakService.java | 4 +- .../service/SpraakService.java | 4 +- .../utils/EndringsmeldingUtil.java | 4 +- .../utils/ServiceRutineUtil.java | 2 +- .../utils/TranslittereringUtil.java | 6 +-- ...lientRequestObservationConventionTest.java | 8 +--- 44 files changed, 121 insertions(+), 139 deletions(-) delete mode 100644 apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/XmlMapperConfig.java diff --git a/apps/budpro-service/build.gradle b/apps/budpro-service/build.gradle index 2c9b2b47751..db7d862a3d2 100644 --- a/apps/budpro-service/build.gradle +++ b/apps/budpro-service/build.gradle @@ -1,9 +1,10 @@ plugins { id 'java' id 'org.springframework.boot' version '3.2.1' - id 'io.spring.dependency-management' version '1.1.3' + id 'io.spring.dependency-management' version '1.1.4' id "jacoco" id "org.sonarqube" version "4.0.0.2929" + id("org.openrewrite.rewrite") version("6.6.4") } bootJar { @@ -11,6 +12,10 @@ bootJar { mainClass = 'no.nav.dolly.budpro.BudproServiceApplication' } +rewrite { + activeRecipe("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2") +} + configurations { compileOnly { extendsFrom annotationProcessor @@ -39,11 +44,13 @@ repositories { dependencyManagement { applyMavenExclusions = false imports { - mavenBom "org.springframework.cloud:spring-cloud-dependencies:2022.0.4" + mavenBom "org.springframework.cloud:spring-cloud-dependencies:2023.0.0" } } dependencies { + rewrite("org.openrewrite.recipe:rewrite-spring:5.2.0") + annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' @@ -73,6 +80,7 @@ dependencies { testAnnotationProcessor 'org.projectlombok:lombok' + testImplementation "org.junit.jupiter:junit-jupiter:5.10.1" testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.testcontainers:junit-jupiter' } diff --git a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/ressursnummer/ResourceNumberGenerator.java b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/ressursnummer/ResourceNumberGenerator.java index 4111fc3c6df..105dd393cd1 100644 --- a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/ressursnummer/ResourceNumberGenerator.java +++ b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/ressursnummer/ResourceNumberGenerator.java @@ -20,7 +20,7 @@ public String next() { var a = random.nextInt(99); var b = random.nextInt(99); var c = random.nextInt(99); - generated = String.format("%02d%02d%02d", a, b, c); + generated = "%02d%02d%02d".formatted(a, b, c); } while (assigned.contains(generated)); assigned.add(generated); return generated; diff --git a/apps/budpro-service/src/test/java/no/nav/dolly/budpro/generate/BudproControllerTest.java b/apps/budpro-service/src/test/java/no/nav/dolly/budpro/generate/BudproControllerTest.java index 84e14433dae..2c50833c75d 100644 --- a/apps/budpro-service/src/test/java/no/nav/dolly/budpro/generate/BudproControllerTest.java +++ b/apps/budpro-service/src/test/java/no/nav/dolly/budpro/generate/BudproControllerTest.java @@ -43,7 +43,7 @@ class BudproControllerTest { private AutoCloseable closeable; @BeforeEach - public void before() { + void before() { closeable = MockitoAnnotations.openMocks(this); var names = new ArrayList(100); @@ -56,12 +56,12 @@ public void before() { } @AfterEach - public void after() throws Exception { + void after() throws Exception { closeable.close(); } @Test - void testThatNoSeedGivesDifferentResults() + void thatNoSeedGivesDifferentResults() throws Exception { var result1 = mockMvc .perform(get("/api/random?limit={limit}", 50)) @@ -80,7 +80,7 @@ void testThatNoSeedGivesDifferentResults() } @Test - void testThatSameSeedGivesSameResults() + void thatSameSeedGivesSameResults() throws Exception { var result1 = mockMvc .perform(get("/api/random?seed={seed}&limit={limit}", 123L, 50)) @@ -99,7 +99,7 @@ void testThatSameSeedGivesSameResults() } @Test - void testThatOverrideWorksAsIntended() + void thatOverrideWorksAsIntended() throws Exception { var override = new BudproRecord( "OVERRIDE", diff --git a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/SecurityConfig.java b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/SecurityConfig.java index cdd6afb30bd..7b1b9e89e5b 100644 --- a/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/SecurityConfig.java +++ b/apps/inntektsmelding-service/src/main/java/no/nav/registre/testnav/inntektsmeldingservice/config/SecurityConfig.java @@ -3,8 +3,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; @@ -16,25 +18,23 @@ public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception { - httpSecurity.sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and().csrf().disable() - .authorizeHttpRequests() - .requestMatchers( - "/internal/**", - "/webjars/**", - "/h2/**", - "/swagger-resources/**", - "/v3/api-docs/**", - "/swagger-ui/**", - "/swagger", - "/error", - "/swagger-ui.html" - ).permitAll() - .requestMatchers("/api/**").fullyAuthenticated() - .and() - .oauth2ResourceServer() - .jwt(); + httpSecurity.sessionManagement(managementConfigurer -> + managementConfigurer.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .csrf(AbstractHttpConfigurer::disable) + .authorizeHttpRequests(matcherRegistry -> matcherRegistry.requestMatchers( + "/internal/**", + "/webjars/**", + "/h2/**", + "/swagger-resources/**", + "/v3/api-docs/**", + "/swagger-ui/**", + "/swagger", + "/error", + "/swagger-ui.html") + .permitAll() + .requestMatchers("/api/**").fullyAuthenticated()) + .oauth2ResourceServer(httpSecurityOAuth2ResourceServerConfigurer -> httpSecurityOAuth2ResourceServerConfigurer + .jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/SecurityConfig.java b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/SecurityConfig.java index a49293de860..b6101336dae 100644 --- a/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/SecurityConfig.java +++ b/apps/oversikt-frontend/src/main/java/no/nav/testnav/apps/oversiktfrontend/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Value; 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.reactive.EnableWebFluxSecurity; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; @@ -21,12 +22,10 @@ public class SecurityConfig { @Bean public SecurityWebFilterChain configure(ServerHttpSecurity http) { - http.cors() - .and().csrf().disable() - .authorizeExchange() - .anyExchange() - .permitAll() - .and().oauth2ResourceServer().jwt(jwt -> jwtDecoder()); + http.cors(Customizer.withDefaults()) + .csrf(ServerHttpSecurity.CsrfSpec::disable) + .authorizeExchange(authorizeExchangeSpec -> authorizeExchangeSpec.anyExchange().permitAll()) + .oauth2ResourceServer(oAuth2ResourceServerSpec -> oAuth2ResourceServerSpec.jwt(jwtSpec -> jwtDecoder())); return http.build(); } diff --git a/apps/tps-messaging-service/build.gradle b/apps/tps-messaging-service/build.gradle index cef8f7ef43a..a9751899f54 100644 --- a/apps/tps-messaging-service/build.gradle +++ b/apps/tps-messaging-service/build.gradle @@ -4,6 +4,7 @@ plugins { id 'org.springframework.boot' version "3.2.1" id 'io.spring.dependency-management' version "1.1.4" id "jacoco" + id("org.openrewrite.rewrite") version("6.6.4") } test { @@ -11,6 +12,10 @@ test { jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED' } +rewrite { + activeRecipe("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2") +} + jacocoTestReport { reports { xml.required = true @@ -34,6 +39,7 @@ sonarqube { } bootJar { + duplicatesStrategy(DuplicatesStrategy.INCLUDE) archiveFileName = "app.jar" } @@ -69,6 +75,7 @@ configurations.implementation { } dependencies { + rewrite("org.openrewrite.recipe:rewrite-spring:5.2.0") implementation 'no.nav.testnav.libs:security-core' implementation 'no.nav.testnav.libs:servlet-core' implementation 'no.nav.testnav.libs:servlet-security' @@ -81,16 +88,14 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' + implementation 'com.fasterxml.jackson.core:jackson-annotations' implementation 'com.fasterxml.jackson.core:jackson-databind' - implementation 'com.ibm.mq:mq-jms-spring-boot-starter:3.0.3' - implementation 'com.ibm.icu:icu4j:72.1' - - implementation 'javax.xml.bind:jaxb-api:2.3.1' - implementation 'javax.json.bind:javax.json.bind-api:1.0' - implementation 'javax.activation:activation:1.1.1' - implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.0' - implementation 'com.sun.xml.bind:jaxb-core:2.3.0.1' + implementation 'com.ibm.mq:mq-jms-spring-boot-starter:3.2.1' + implementation 'com.ibm.icu:icu4j:74.2' + + implementation 'jakarta.xml.bind:jakarta.xml.bind-api' + implementation 'com.sun.xml.bind:jaxb-core' implementation 'org.glassfish.jaxb:jaxb-runtime' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' @@ -102,7 +107,7 @@ dependencies { implementation 'io.micrometer:micrometer-registry-prometheus' implementation 'ma.glasnost.orika:orika-core:1.5.4' implementation 'org.hibernate.validator:hibernate-validator' - implementation 'org.aspectj:aspectjweaver:1.9.7' + implementation 'org.aspectj:aspectjweaver:1.9.19' implementation 'net.logstash.logback:logstash-logback-encoder:7.4' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0' @@ -112,4 +117,6 @@ dependencies { implementation 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testAnnotationProcessor 'org.projectlombok:lombok' + + testImplementation "org.junit.jupiter:junit-jupiter:5.10.1" } \ No newline at end of file diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/XmlMapperConfig.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/XmlMapperConfig.java deleted file mode 100644 index 7d460b03a45..00000000000 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/XmlMapperConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package no.nav.testnav.apps.tpsmessagingservice.config; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class XmlMapperConfig { - - @Bean - public XmlMapper xmlMapper() { - return XmlMapper - .builder() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true) - .configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true) - .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) - .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true) - .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) - .build(); - } - -} diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/EndringsmeldingConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/EndringsmeldingConsumer.java index 2daa6bfeff5..7ee998ff96a 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/EndringsmeldingConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/EndringsmeldingConsumer.java @@ -7,8 +7,8 @@ import no.nav.testnav.apps.tpsmessagingservice.factory.ConnectionFactoryFactory; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.io.StringWriter; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -29,7 +29,7 @@ public EndringsmeldingConsumer(ConnectionFactoryFactory connectionFactoryFactory protected String getQueueName(String queue, String miljoe) { return isBlank(queue) ? - String.format("%s%s_%s", PREFIX_MQ_QUEUES, miljoe.toUpperCase(), + "%s%s_%s".formatted(PREFIX_MQ_QUEUES, miljoe.toUpperCase(), XML_REQUEST_QUEUE_ENDRINGSMELDING_ALIAS) : queue; } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/ServicerutineConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/ServicerutineConsumer.java index e103af7f94e..18d8c4df27e 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/ServicerutineConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/ServicerutineConsumer.java @@ -6,8 +6,8 @@ import no.nav.testnav.apps.tpsmessagingservice.factory.ConnectionFactoryFactory; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.io.StringWriter; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -28,7 +28,7 @@ public ServicerutineConsumer(ConnectionFactoryFactory connectionFactoryFactory) protected String getQueueName(String queue, String miljoe) { return isBlank(queue) ? - String.format("%s%s_%s", PREFIX_MQ_QUEUES, miljoe.toUpperCase(), + "%s%s_%s".formatted(PREFIX_MQ_QUEUES, miljoe.toUpperCase(), XML_REQUEST_QUEUE_SERVICE_RUTINE_ALIAS) : queue; } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java index 77436bca314..c72482156b9 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/TpsConsumer.java @@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.Objects; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java index 184dbd9f56f..4a3544ce01c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/consumer/command/TpsMeldingCommand.java @@ -63,14 +63,14 @@ public String call() throws JMSException, JmqiException { producer.send(requestMessage); } } catch (JMSException e) { - log.warn(String.format("%s: %s", FEIL_KOENAVN, e.getMessage()), e); + log.warn("%s: %s".formatted(FEIL_KOENAVN, e.getMessage()), e); return e.getMessage(); } TextMessage responseMessage; /* Wait for response */ - String attributes = String.format("JMSCorrelationID='%s'", requestMessage.getJMSMessageID()); + String attributes = "JMSCorrelationID='%s'".formatted(requestMessage.getJMSMessageID()); try (MessageConsumer consumer = session.createConsumer(responseDestination, attributes)) { diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskRequest.java index 7f20c5ba373..625ca635bfa 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskRequest.java @@ -5,8 +5,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskResponse.java index e89d3d659b3..5257989293b 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoNorskResponse.java @@ -5,7 +5,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandRequest.java index 44ec5360fc0..f001d0bea9b 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandRequest.java @@ -5,8 +5,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandResponse.java index 48c2da1de5e..df3d5fda5c8 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/BankkontoUtlandResponse.java @@ -5,7 +5,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattRequest.java index fa76006c75b..eb2ae56008e 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattRequest.java @@ -8,8 +8,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattResponse.java index 0b00c236c02..36692c2e025 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/EgenansattResponse.java @@ -6,7 +6,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerRequest.java index 7b1242956d0..da30f78b05c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerRequest.java @@ -9,8 +9,8 @@ import lombok.experimental.SuperBuilder; import no.nav.testnav.libs.data.tpsmessagingservice.v1.TelefonTypeNummerDTO; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import java.util.List; @Data diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerResponse.java index 95ae53feec1..56560c6fa47 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/KontaktopplysningerResponse.java @@ -6,7 +6,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SfePersonDataErrorResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SfePersonDataErrorResponse.java index 39cc3575ac6..f73b95052f5 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SfePersonDataErrorResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SfePersonDataErrorResponse.java @@ -3,7 +3,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @SuperBuilder @NoArgsConstructor diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakRequest.java index 77773276e19..9f78c0345a9 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakRequest.java @@ -8,8 +8,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakResponse.java index c8f81bcf8f5..d05bfa0d0a6 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SikkerhetstiltakResponse.java @@ -6,7 +6,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakRequest.java index 19d1d4ce522..3690473446c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakRequest.java @@ -5,8 +5,8 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakResponse.java index 5802c76f163..9767b645e7c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/SpraakResponse.java @@ -5,7 +5,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsEndringsopplysninger.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsEndringsopplysninger.java index 2f35e528205..845e026accd 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsEndringsopplysninger.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsEndringsopplysninger.java @@ -6,7 +6,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlType; @Data @SuperBuilder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsPersonDataErrorResponse.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsPersonDataErrorResponse.java index bc301ea802e..2715f3a8fbb 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsPersonDataErrorResponse.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsPersonDataErrorResponse.java @@ -5,7 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Builder @NoArgsConstructor diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java index 24f0a28ccb8..c6901b839c5 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServiceRutine.java @@ -5,7 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlType; @Data @Builder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java index 4edca47fde4..e0d4bf2febb 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineM201Response.java @@ -10,8 +10,8 @@ import lombok.NoArgsConstructor; import no.nav.tps.ctg.m201.domain.TpsServiceRutineType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java index 22f7ce43e54..4a9f69f5fe5 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsServicerutineRequest.java @@ -6,7 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlRootElement; @Data @Builder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsSystemInfo.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsSystemInfo.java index d94489562fe..fa2e3dc3c6c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsSystemInfo.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/dto/TpsSystemInfo.java @@ -5,7 +5,7 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlType; @Data @Builder diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/factory/CachedConnectionFactoryFactory.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/factory/CachedConnectionFactoryFactory.java index 03bc6870493..7d26e78d43c 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/factory/CachedConnectionFactoryFactory.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/factory/CachedConnectionFactoryFactory.java @@ -34,7 +34,7 @@ public ConnectionFactory createConnectionFactory(QueueManager queueManager) thro factory.setChannel(queueManager.channel()); if (log.isInfoEnabled()) { - log.info(String.format("Creating connection factory '%s@%s:%d' on channel '%s' using transport type '%d'", + log.info("Creating connection factory '%s@%s:%d' on channel '%s' using transport type '%d'".formatted( factory.getQueueManager(), factory.getHostName(), factory.getPort(), diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java index abeb720d1bd..dcd08fd69ec 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/AdresseMappingStrategy.java @@ -16,7 +16,6 @@ import java.time.LocalDate; import java.time.LocalDateTime; -import static java.lang.String.format; import static java.util.Objects.nonNull; import static no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO.Adressetype.GATE; import static no.nav.testnav.libs.data.tpsmessagingservice.v1.AdresseDTO.Adressetype.MATR; @@ -52,7 +51,7 @@ public void mapAtoB(PostAdresseType source, PostadresseDTO target, MappingContex if (POST_NORGE.equals(source.getAdresseType())) { - target.setPostLinje3(format("%s %s", source.getPostnr(), source.getPoststed())); + target.setPostLinje3("%s %s".formatted(source.getPostnr(), source.getPoststed())); target.setPostLand(NORGE); } else { diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/BankkontonrNorskMappingStrategy.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/BankkontonrNorskMappingStrategy.java index 9f541362384..3e98c52cb54 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/BankkontonrNorskMappingStrategy.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/mapper/BankkontonrNorskMappingStrategy.java @@ -11,7 +11,6 @@ import java.time.LocalDate; -import static java.lang.String.format; import static java.util.Objects.isNull; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; @@ -70,7 +69,7 @@ public void mapAtoB(BankkontonrNorskDTO source, BankkontoNorskRequest.BrukerIden public void mapAtoB(BankkontoNorgeType source, BankkontonrNorskDTO target, MappingContext context) { target.setKontonummer(isBlank(source.getKontoNummer()) ? null : - format("%s.%s.%s", source.getKontoNummer().substring(0, 4), + "%s.%s.%s".formatted(source.getKontoNummer().substring(0, 4), source.getKontoNummer().substring(4, 6), source.getKontoNummer().substring(6))); target.setKontoRegdato(isBlank(source.getRegTidspunkt()) ? null : diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoNorskService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoNorskService.java index 05c38a36872..d06c15fb25b 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoNorskService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoNorskService.java @@ -12,8 +12,8 @@ import no.nav.testnav.libs.data.kontoregister.v1.BankkontonrNorskDTO; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.stream.Collectors; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoUtlandService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoUtlandService.java index 26b6ca28743..2c4b34fdb11 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoUtlandService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/BankkontoUtlandService.java @@ -12,8 +12,8 @@ import no.nav.testnav.libs.data.kontoregister.v1.BankkontonrUtlandDTO; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.stream.Collectors; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/EgenansattService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/EgenansattService.java index e1a30666c4b..c802a804804 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/EgenansattService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/EgenansattService.java @@ -12,8 +12,8 @@ import no.nav.testnav.apps.tpsmessagingservice.dto.TpsMeldingResponse; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.time.LocalDate; import java.util.List; import java.util.Map; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java index 73c6c471d7b..460e6f249f9 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/IdentService.java @@ -1,6 +1,8 @@ package no.nav.testnav.apps.tpsmessagingservice.service; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import no.nav.testnav.apps.tpsmessagingservice.consumer.ServicerutineConsumer; @@ -15,8 +17,6 @@ import no.nav.tps.ctg.m201.domain.TpsServiceRutineType; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; import java.io.StringWriter; import java.util.HashMap; import java.util.List; @@ -39,15 +39,15 @@ public class IdentService { private final ServicerutineConsumer servicerutineConsumer; private final JAXBContext requestContext; private final TestmiljoerServiceConsumer testmiljoerServiceConsumer; - private final XmlMapper xmlMapper; + private final ObjectMapper objectMapper; public IdentService(ServicerutineConsumer servicerutineConsumer, TestmiljoerServiceConsumer testmiljoerServiceConsumer, - XmlMapper xmlMapper) throws JAXBException { + ObjectMapper objectMapper) throws JAXBException { this.servicerutineConsumer = servicerutineConsumer; this.testmiljoerServiceConsumer = testmiljoerServiceConsumer; this.requestContext = JAXBContext.newInstance(TpsPersonData.class); - this.xmlMapper = xmlMapper; + this.objectMapper = objectMapper; } @SneakyThrows @@ -125,7 +125,7 @@ private TpsServicerutineM201Response unmarshallFromXml(String endringsmeldingRes .build(); } else { - return xmlMapper.readValue(endringsmeldingResponse, TpsServicerutineM201Response.class); + return objectMapper.readValue(endringsmeldingResponse, TpsServicerutineM201Response.class); } } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java index 544bb512ede..580f1c9852f 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/PersonService.java @@ -26,8 +26,8 @@ import org.json.XML; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SikkerhetstiltakService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SikkerhetstiltakService.java index 230e9b6db06..eaa2b56b79b 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SikkerhetstiltakService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SikkerhetstiltakService.java @@ -12,8 +12,8 @@ import no.nav.testnav.libs.data.tpsmessagingservice.v1.SikkerhetTiltakDTO; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.Map.Entry; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SpraakService.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SpraakService.java index 5a7fd206873..b53f2dd627d 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SpraakService.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/service/SpraakService.java @@ -12,8 +12,8 @@ import no.nav.testnav.libs.data.tpsmessagingservice.v1.SpraakDTO; import org.springframework.stereotype.Service; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.util.List; import java.util.Map; import java.util.stream.Collectors; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/EndringsmeldingUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/EndringsmeldingUtil.java index b3ef9da96f7..a2e85aa1be0 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/EndringsmeldingUtil.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/EndringsmeldingUtil.java @@ -7,8 +7,8 @@ import no.nav.testnav.apps.tpsmessagingservice.dto.EndringsmeldingResponse; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsMeldingResponse; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import java.io.StringReader; import java.io.StringWriter; diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java index a1e1238c7a6..5833499e2f0 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/ServiceRutineUtil.java @@ -4,7 +4,7 @@ import lombok.experimental.UtilityClass; import no.nav.testnav.apps.tpsmessagingservice.dto.TpsServicerutineRequest; -import javax.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBContext; import java.io.StringWriter; @UtilityClass diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java index f076ecae919..8e6383d5fbb 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/utils/TranslittereringUtil.java @@ -53,9 +53,9 @@ public String translitterer(String str) { return null; } - val prepared = preprocess(str); - val normalized = pattern.matcher(Normalizer.normalize(prepared, Normalizer.Form.NFD)).replaceAll(""); - val processed = postprocess(normalized); + final var prepared = preprocess(str); + final var normalized = pattern.matcher(Normalizer.normalize(prepared, Normalizer.Form.NFD)).replaceAll(""); + final var processed = postprocess(normalized); String text = convertKnownCharactersNotHandledByNormalization(processed); return cyrillicToLatinTrans.transliterate(text); } diff --git a/libs/reactive-core/src/test/java/no/nav/testnav/libs/reactivecore/metrics/UriStrippingClientRequestObservationConventionTest.java b/libs/reactive-core/src/test/java/no/nav/testnav/libs/reactivecore/metrics/UriStrippingClientRequestObservationConventionTest.java index 0dce08f6c4c..fd9dbea0fab 100644 --- a/libs/reactive-core/src/test/java/no/nav/testnav/libs/reactivecore/metrics/UriStrippingClientRequestObservationConventionTest.java +++ b/libs/reactive-core/src/test/java/no/nav/testnav/libs/reactivecore/metrics/UriStrippingClientRequestObservationConventionTest.java @@ -26,13 +26,9 @@ class UriStrippingClientRequestObservationConventionTest { void testUriStripping() throws URISyntaxException { - var context = new ClientRequestObservationContext(); + var context = new ClientRequestObservationContext(ClientRequest + .create(GET, new URI(BASE_URI + PATH_AND_PARAMETERS))); context.setUriTemplate(BASE_URI + PATH_AND_PARAMETERS_AND_TEMPLATE); - context.setRequest( - ClientRequest - .create(GET, new URI(BASE_URI + PATH_AND_PARAMETERS)) - .build() - ); context.setResponse( ClientResponse .create(HttpStatusCode.valueOf(200))