Add nullability annotations to tests in module/spring-boot-security-oauth2-authorization-server

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-13 15:15:50 +02:00
parent cddd8e3dd1
commit 42744bdae9
2 changed files with 6 additions and 1 deletions
@@ -39,3 +39,7 @@ dependencies {
testRuntimeOnly("ch.qos.logback:logback-classic")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
@@ -19,6 +19,7 @@ package org.springframework.boot.security.oauth2.server.authorization.autoconfig
import java.util.List;
import jakarta.servlet.Filter;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
@@ -118,7 +119,7 @@ class OAuth2AuthorizationServerWebSecurityConfigurationTests {
});
}
private Filter findFilter(AssertableWebApplicationContext context, Class<? extends Filter> filter,
private @Nullable Filter findFilter(AssertableWebApplicationContext context, Class<? extends Filter> filter,
int filterChainIndex) {
FilterChainProxy filterChain = (FilterChainProxy) context.getBean(BeanIds.SPRING_SECURITY_FILTER_CHAIN);
List<SecurityFilterChain> filterChains = filterChain.getFilterChains();