diff --git a/build.gradle.kts b/build.gradle.kts index 85b16d63..9df567b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { jacoco `jvm-test-suite` id("io.freefair.lombok") version "8.11" - id("org.springframework.boot") version "3.2.5" + id("org.springframework.boot") version "3.4.0" id("io.spring.dependency-management") version "1.1.7" id("org.graalvm.buildtools.native") version "0.10.4" id("com.github.rising3.semver") version "0.8.2" @@ -29,7 +29,7 @@ dependencies { implementation("net.logstash.logback:logstash-logback-encoder:8.0") implementation("ch.qos.logback:logback-classic") - implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2023.0.0")) + implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2024.0.0")) implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-oauth2-client") diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index a6d1f545..f6e6e0d5 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -58,6 +58,10 @@ spring: filter: local-response-cache: enabled: false + # Disable matching the port in the host header to enable backward compatibility. + predicate: + host: + include-port: false # Non-spring configuration goes here! morp: diff --git a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java index f74c5977..2682915d 100644 --- a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java +++ b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java @@ -4,7 +4,6 @@ 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.mock.mockito.MockBean; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.oauth2.client.registration.ClientRegistration; @@ -13,6 +12,7 @@ import org.springframework.security.oauth2.core.OAuth2AccessToken; import org.springframework.security.oauth2.core.user.DefaultOAuth2User; import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import reactor.test.StepVerifier; import java.io.BufferedReader; @@ -38,7 +38,7 @@ class MorpReactiveOAuth2UserServiceTest { @Autowired MorpReactiveOAuth2UserService userService; - @MockBean + @MockitoBean TenantService tenantService; @Test diff --git a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java index cf1c9cdd..b9eff4fe 100644 --- a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java +++ b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java @@ -4,7 +4,6 @@ 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.mock.mockito.MockBean; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest; @@ -14,6 +13,7 @@ import org.springframework.security.oauth2.core.oidc.OidcIdToken; import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser; import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import reactor.test.StepVerifier; import java.time.Instant; @@ -34,7 +34,7 @@ class MorpReactiveOidcUserServiceTest { @Autowired MorpReactiveOidcUserService userService; - @MockBean + @MockitoBean TenantService tenantService; @Test diff --git a/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java b/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java index 6bbcd572..2fd6ffae 100644 --- a/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java +++ b/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java @@ -5,9 +5,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import java.util.Map; import java.util.Set; @@ -23,10 +23,10 @@ class RegistrationResolverTest { @Autowired RegistrationResolver registrationResolver; - @MockBean + @MockitoBean OAuth2ClientProperties properties; - @MockBean + @MockitoBean TenantService tenantService; private static OAuth2ClientProperties.Registration tenantRegistration() { diff --git a/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java b/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java index 75adc01c..80e98ab5 100644 --- a/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java +++ b/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java @@ -6,11 +6,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.cache.CacheManager; import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.test.context.aot.DisabledInAotMode; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import reactor.test.StepVerifier; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -29,13 +29,13 @@ class TenantAwareClientRegistrationRepositoryTest { @Autowired private CacheManager cacheManager; - @MockBean + @MockitoBean private ClientRegistrationFetcher clientRegistrationFetcher; - @MockBean + @MockitoBean private RegistrationResolver registrationResolver; - @MockBean + @MockitoBean private ProviderResolver providerResolver; private ClientRegistration clientRegistration = ClientRegistration.withRegistrationId(TENANT)