diff --git a/pom.xml b/pom.xml index a3dccf00..ac1825e2 100644 --- a/pom.xml +++ b/pom.xml @@ -104,27 +104,21 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + -parameters + + + org.jetbrains.kotlin kotlin-maven-plugin ${kotlin.version} - - - compile - compile - - compile - - - - test-compile - test-compile - - test-compile - - - + true -Xjsr305=strict @@ -141,6 +135,7 @@ ${kotlin.version} + true org.apache.maven.plugins diff --git a/token-client-core/pom.xml b/token-client-core/pom.xml index 698979b9..0cf7e75f 100644 --- a/token-client-core/pom.xml +++ b/token-client-core/pom.xml @@ -44,14 +44,9 @@ - org.apache.maven.plugins - maven-compiler-plugin - - - -parameters - - - + org.apache.maven.plugins + maven-compiler-plugin + org.apache.maven.plugins maven-source-plugin diff --git a/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/ApplicationTest.kt b/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/ApplicationTest.kt index 7c6e9d1f..8231631f 100644 --- a/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/ApplicationTest.kt +++ b/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/ApplicationTest.kt @@ -78,16 +78,16 @@ internal class ApplicationTest { ) { (environment.config as MapApplicationConfig).apply { val prefix = "no.nav.security.jwt" - put("${prefix}.issuers.size", "1") - put("${prefix}.issuers.0.issuer_name", issuerId) - put("${prefix}.issuers.0.discoveryurl", "${server.wellKnownUrl(issuerId)}") - put("${prefix}.issuers.0.accepted_audience", acceptedAudience) - put("${prefix}.client.registration.clients.size", "1") - put("${prefix}.client.registration.clients.0.client_name", "issuer1") - put("${prefix}.client.registration.clients.0.well_known_url", "${server.wellKnownUrl(issuerId)}") - put("${prefix}.client.registration.clients.0.authentication.client_id", "client1") - put("${prefix}.client.registration.clients.0.authentication.client_auth_method", "private_key_jwt") - put("${prefix}.client.registration.clients.0.authentication.client_jwk", jwk) + put("$prefix.issuers.size", "1") + put("$prefix.issuers.0.issuer_name", issuerId) + put("$prefix.issuers.0.discoveryurl", "${server.wellKnownUrl(issuerId)}") + put("$prefix.issuers.0.accepted_audience", acceptedAudience) + put("$prefix.client.registration.clients.size", "1") + put("$prefix.client.registration.clients.0.client_name", "issuer1") + put("$prefix.client.registration.clients.0.well_known_url", "${server.wellKnownUrl(issuerId)}") + put("$prefix.client.registration.clients.0.authentication.client_id", "client1") + put("$prefix.client.registration.clients.0.authentication.client_auth_method", "private_key_jwt") + put("$prefix.client.registration.clients.0.authentication.client_jwk", jwk) } } diff --git a/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/oauth/OAuth2ClientIntegrationTest.kt b/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/oauth/OAuth2ClientIntegrationTest.kt index efb62789..c2cad6c1 100644 --- a/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/oauth/OAuth2ClientIntegrationTest.kt +++ b/token-client-kotlin-demo/src/test/kotlin/no/nav/security/token/support/ktor/oauth/OAuth2ClientIntegrationTest.kt @@ -32,7 +32,7 @@ internal class OAuth2ClientIntegrationTest { // TODO: fix test on github actions @Test - @Disabled("fails on github actions, but runs fine in Idea and mvn locally, maybe something with clock/time") + @Disabled("fails on github actions, but runs fine in Idea and mvn locally, maybe something with clock/time") fun `token request should return cached response on second request with same request`() { withMockOAuth2Server { this.enqueueCallback( diff --git a/token-client-spring/pom.xml b/token-client-spring/pom.xml index 9c05de57..292de2e6 100644 --- a/token-client-spring/pom.xml +++ b/token-client-spring/pom.xml @@ -99,9 +99,6 @@ org.jetbrains.kotlin kotlin-maven-plugin - - true - org.apache.maven.plugins diff --git a/token-validation-core/pom.xml b/token-validation-core/pom.xml index 14a0d525..2dbada79 100644 --- a/token-validation-core/pom.xml +++ b/token-validation-core/pom.xml @@ -42,6 +42,10 @@ + + org.apache.maven.plugins + maven-compiler-plugin + org.apache.maven.plugins maven-source-plugin diff --git a/token-validation-filter/pom.xml b/token-validation-filter/pom.xml index 4cd0d91d..4a33efaa 100644 --- a/token-validation-filter/pom.xml +++ b/token-validation-filter/pom.xml @@ -34,6 +34,10 @@ org.apache.maven.plugins maven-source-plugin + + org.apache.maven.plugins + maven-source-plugin + org.apache.maven.plugins maven-javadoc-plugin diff --git a/token-validation-jaxrs/pom.xml b/token-validation-jaxrs/pom.xml index ee63b6cc..0943d0b9 100644 --- a/token-validation-jaxrs/pom.xml +++ b/token-validation-jaxrs/pom.xml @@ -68,6 +68,10 @@ + + org.apache.maven.plugins + maven-compiler-plugin + org.apache.maven.plugins maven-source-plugin diff --git a/token-validation-ktor-demo/pom.xml b/token-validation-ktor-demo/pom.xml index 92c5519c..fad97b94 100644 --- a/token-validation-ktor-demo/pom.xml +++ b/token-validation-ktor-demo/pom.xml @@ -79,7 +79,6 @@ org.apache.maven.plugins maven-surefire-plugin - org.jetbrains.kotlin kotlin-maven-plugin diff --git a/token-validation-ktor-v2/pom.xml b/token-validation-ktor-v2/pom.xml index fc1abe09..4beef882 100644 --- a/token-validation-ktor-v2/pom.xml +++ b/token-validation-ktor-v2/pom.xml @@ -59,11 +59,15 @@ - com.github.tomakehurst + org.wiremock wiremock - 2.27.2 + 3.3.1 test + + jakarta.servlet + jakarta.servlet-api + commons-logging @@ -117,7 +121,6 @@ - diff --git a/token-validation-spring-demo/src/test/java/no/nav/security/token/support/demo/spring/rest/DemoControllerTest.java b/token-validation-spring-demo/src/test/java/no/nav/security/token/support/demo/spring/rest/DemoControllerTest.java index caf63a71..c84c08af 100644 --- a/token-validation-spring-demo/src/test/java/no/nav/security/token/support/demo/spring/rest/DemoControllerTest.java +++ b/token-validation-spring-demo/src/test/java/no/nav/security/token/support/demo/spring/rest/DemoControllerTest.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.http.HttpStatus; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder; @@ -21,9 +22,11 @@ import java.util.Collections; import java.util.List; +import static io.restassured.module.mockmvc.RestAssuredMockMvc.*; import static io.restassured.module.mockmvc.RestAssuredMockMvc.given; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.*; -@SpringBootTest(classes = DemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = DemoApplication.class, webEnvironment = RANDOM_PORT) @ActiveProfiles("test") @EnableMockOAuth2Server class DemoControllerTest { @@ -35,15 +38,15 @@ class DemoControllerTest { @BeforeEach void initialiseRestAssuredMockMvcWebApplicationContext() { - Collection filterCollection = webApplicationContext.getBeansOfType(Filter.class).values(); - Filter[] filters = filterCollection.toArray(new Filter[0]); - MockMvcConfigurer mockMvcConfigurer = new MockMvcConfigurer() { + var filterCollection = webApplicationContext.getBeansOfType(Filter.class).values(); + var filters = filterCollection.toArray(new Filter[0]); + var mockMvcConfigurer = new MockMvcConfigurer() { @Override public void afterConfigurerAdded(ConfigurableMockMvcBuilder builder) { builder.addFilters(filters); } }; - RestAssuredMockMvc.webAppContextSetup(webApplicationContext, mockMvcConfigurer); + webAppContextSetup(webApplicationContext, mockMvcConfigurer); } @Test @@ -94,4 +97,4 @@ private String token(String issuerId, String subject, String audience){ ) ).serialize(); } -} +} \ No newline at end of file diff --git a/token-validation-spring/pom.xml b/token-validation-spring/pom.xml index 9c0a7d18..127a1b47 100644 --- a/token-validation-spring/pom.xml +++ b/token-validation-spring/pom.xml @@ -159,29 +159,6 @@ org.apache.maven.plugins maven-javadoc-plugin - - org.apache.maven.plugins - maven-compiler-plugin - - true - - - - compile - compile - - compile - - - - testCompile - test-compile - - testCompile - - - -