mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Add nullability annotations to tests in module/spring-boot-micrometer-metrics-test
See gh-47263
This commit is contained in:
@@ -35,3 +35,7 @@ dependencies {
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
|
||||
tasks.named("compileTestJava") {
|
||||
options.nullability.checking = "tests"
|
||||
}
|
||||
|
||||
+5
-1
@@ -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 AutoConfigureMetrics} and {@link MetricsContextCustomizerFactory}
|
||||
@@ -131,7 +134,8 @@ class MetricsContextCustomizerFactoryTests {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user