Browse Source

Fix config/src/test/kotlin nullability for web

Issue gh-17535
pull/17191/merge
Rob Winch 4 months ago
parent
commit
a58f3282d9
No known key found for this signature in database
  1. 5
      config/src/test/kotlin/org/springframework/security/config/annotation/web/OneTimeTokenLoginDslTests.kt
  2. 4
      config/src/test/kotlin/org/springframework/security/config/web/server/ServerOAuth2ResourceServerDslTests.kt
  3. 4
      config/src/test/kotlin/org/springframework/security/config/web/server/ServerOneTimeTokenLoginDslTests.kt

5
config/src/test/kotlin/org/springframework/security/config/annotation/web/OneTimeTokenLoginDslTests.kt

@ -22,7 +22,6 @@ import io.mockk.mockk @@ -22,7 +22,6 @@ import io.mockk.mockk
import io.mockk.verify
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
@ -44,7 +43,6 @@ import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequ @@ -44,7 +43,6 @@ import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequ
import org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
import org.springframework.security.web.authentication.ott.DefaultGenerateOneTimeTokenRequestResolver
import org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver
import org.springframework.security.web.authentication.ott.OneTimeTokenGenerationSuccessHandler
import org.springframework.security.web.authentication.ott.RedirectOneTimeTokenGenerationSuccessHandler
@ -53,7 +51,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders @@ -53,7 +51,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
import java.time.Duration
import java.time.Instant
import java.time.ZoneOffset
/**
* Tests for [OneTimeTokenLoginDsl]
@ -267,7 +264,7 @@ class OneTimeTokenLoginDslTests { @@ -267,7 +264,7 @@ class OneTimeTokenLoginDslTests {
)
}
constructor(redirectUrl: String?) {
constructor(redirectUrl: String) {
this.delegate =
RedirectOneTimeTokenGenerationSuccessHandler(
redirectUrl

4
config/src/test/kotlin/org/springframework/security/config/web/server/ServerOAuth2ResourceServerDslTests.kt

@ -175,8 +175,8 @@ class ServerOAuth2ResourceServerDslTests { @@ -175,8 +175,8 @@ class ServerOAuth2ResourceServerDslTests {
open class MockServerAuthenticationFailureHandler: ServerAuthenticationFailureHandler {
override fun onAuthenticationFailure(
webFilterExchange: WebFilterExchange?,
exception: AuthenticationException?
webFilterExchange: WebFilterExchange,
exception: AuthenticationException
): Mono<Void> {
return Mono.empty()
}

4
config/src/test/kotlin/org/springframework/security/config/web/server/ServerOneTimeTokenLoginDslTests.kt

@ -280,11 +280,11 @@ class ServerOneTimeTokenLoginDslTests { @@ -280,11 +280,11 @@ class ServerOneTimeTokenLoginDslTests {
this.delegate = ServerRedirectOneTimeTokenGenerationSuccessHandler("/login/ott")
}
constructor(redirectUrl: String?) {
constructor(redirectUrl: String) {
this.delegate = ServerRedirectOneTimeTokenGenerationSuccessHandler(redirectUrl)
}
override fun handle(exchange: ServerWebExchange?, oneTimeToken: OneTimeToken?): Mono<Void> {
override fun handle(exchange: ServerWebExchange, oneTimeToken: OneTimeToken): Mono<Void> {
lastToken = oneTimeToken
return delegate!!.handle(exchange, oneTimeToken)
}

Loading…
Cancel
Save