Add nullability annotations to tests in module/spring-boot-data-jdbc
See gh-47263
This commit is contained in:
parent
3db8b5fb26
commit
f2c2d19a9c
|
@ -39,3 +39,7 @@ dependencies {
|
||||||
testRuntimeOnly("com.h2database:h2")
|
testRuntimeOnly("com.h2database:h2")
|
||||||
testRuntimeOnly("com.zaxxer:HikariCP")
|
testRuntimeOnly("com.zaxxer:HikariCP")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named("compileTestJava") {
|
||||||
|
options.nullability.checking = "tests"
|
||||||
|
}
|
||||||
|
|
|
@ -126,6 +126,7 @@ class DataJdbcRepositoriesAutoConfigurationTests {
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
JdbcMappingContext mappingContext = context.getBean(JdbcMappingContext.class);
|
JdbcMappingContext mappingContext = context.getBean(JdbcMappingContext.class);
|
||||||
ManagedTypes managedTypes = (ManagedTypes) ReflectionTestUtils.getField(mappingContext, "managedTypes");
|
ManagedTypes managedTypes = (ManagedTypes) ReflectionTestUtils.getField(mappingContext, "managedTypes");
|
||||||
|
assertThat(managedTypes).isNotNull();
|
||||||
assertThat(managedTypes.toList()).containsOnly(City.class);
|
assertThat(managedTypes.toList()).containsOnly(City.class);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue