Add nullability annotations to tests in module/spring-boot-micrometer-tracing-test

See gh-47263
This commit is contained in:
Moritz Halbritter
2025-10-13 13:44:08 +02:00
parent d333dec4cb
commit 7c54b1963f
2 changed files with 9 additions and 1 deletions
@@ -34,3 +34,7 @@ dependencies {
testRuntimeOnly("ch.qos.logback:logback-classic")
}
tasks.named("compileTestJava") {
options.nullability.checking = "tests"
}
@@ -24,8 +24,11 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.test.context.ContextCustomizer;
import org.springframework.test.context.ContextLoader;
import org.springframework.test.context.MergedContextConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
/**
* Tests for {@link AutoConfigureTracing} and {@link TracingContextCustomizerFactory}
@@ -130,7 +133,8 @@ class TracingContextCustomizerFactoryTests {
}
private void applyCustomizerToContext(ContextCustomizer customizer, ConfigurableApplicationContext context) {
customizer.customizeContext(context, null);
customizer.customizeContext(context,
new MergedContextConfiguration(getClass(), null, null, null, mock(ContextLoader.class)));
}
private ContextCustomizer createContextCustomizer(Class<?> testClass) {