diff --git a/kork-web/src/test/groovy/com/netflix/spinnaker/kork/web/exceptions/GenericExceptionHandlersMvcSpec.groovy b/kork-web/src/test/groovy/com/netflix/spinnaker/kork/web/exceptions/GenericExceptionHandlersMvcSpec.groovy index b532a15d5..12be23eca 100644 --- a/kork-web/src/test/groovy/com/netflix/spinnaker/kork/web/exceptions/GenericExceptionHandlersMvcSpec.groovy +++ b/kork-web/src/test/groovy/com/netflix/spinnaker/kork/web/exceptions/GenericExceptionHandlersMvcSpec.groovy @@ -7,18 +7,19 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.boot.test.context.SpringBootTest import org.springframework.boot.test.web.client.TestRestTemplate -import org.springframework.boot.web.server.LocalServerPort +import org.springframework.boot.test.web.server.LocalServerPort import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Import import org.springframework.http.HttpStatus 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.configuration.WebSecurityConfigurerAdapter +import org.springframework.security.web.SecurityFilterChain import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer import spock.lang.Specification @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = TestControllersConfiguration) @@ -95,12 +96,12 @@ class GenericExceptionHandlersMvcSpec extends Specification { @Configuration @EnableWebSecurity - class WebSecurityConfig extends WebSecurityConfigurerAdapter { - @Override - protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable() - .headers().disable() - .authorizeRequests().anyRequest().permitAll() + class WebSecurityConfig implements WebMvcConfigurer { + @Bean + protected SecurityFilterChain configure(HttpSecurity http) throws Exception { + http.csrf().disable().headers().disable() + http.authorizeHttpRequests().anyRequest().permitAll() + return http.build() } } diff --git a/spinnaker-dependencies/spinnaker-dependencies.gradle b/spinnaker-dependencies/spinnaker-dependencies.gradle index fcf568804..2becfb23b 100644 --- a/spinnaker-dependencies/spinnaker-dependencies.gradle +++ b/spinnaker-dependencies/spinnaker-dependencies.gradle @@ -57,7 +57,7 @@ dependencies { api(platform("software.amazon.awssdk:bom:${versions.awsv2}")) api(platform("org.springframework.cloud:spring-cloud-dependencies:${versions.springCloud}")) api(platform("io.strikt:strikt-bom:0.31.0")) - api(platform("org.spockframework:spock-bom:2.3-groovy-4.0")) + api(platform("org.spockframework:spock-bom:2.4-M1-groovy-4.0")) api(platform("com.oracle.oci.sdk:oci-java-sdk-bom:3.21.0")) api(platform("org.testcontainers:testcontainers-bom:1.19.8")) api(platform("io.arrow-kt:arrow-stack:${versions.arrow}")) @@ -110,7 +110,7 @@ dependencies { api("com.nimbusds:nimbus-jose-jwt:9.37.2") api("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") api("com.nhaarman:mockito-kotlin:1.6.0") - api("com.ninja-squad:springmockk:2.0.3") + api("com.ninja-squad:springmockk:4.0.2") //Compatible with Spring boot 3.x and Java 17+ https://github.com/Ninja-Squad/springmockk?tab=readme-ov-file#versions-compatibility api("com.squareup.retrofit2:converter-jackson:${versions.retrofit2}") api("com.squareup.retrofit2:retrofit-mock:${versions.retrofit2}") api("com.squareup.retrofit2:retrofit:${versions.retrofit2}")