Add nullability annotations to tests in module/spring-boot-data-jpa
See gh-47263
This commit is contained in:
parent
f2c2d19a9c
commit
bb19585601
|
@ -49,3 +49,7 @@ dependencies {
|
||||||
testRuntimeOnly("com.zaxxer:HikariCP")
|
testRuntimeOnly("com.zaxxer:HikariCP")
|
||||||
testRuntimeOnly("jakarta.servlet:jakarta.servlet-api")
|
testRuntimeOnly("jakarta.servlet:jakarta.servlet-api")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named("compileTestJava") {
|
||||||
|
options.nullability.checking = "tests"
|
||||||
|
}
|
||||||
|
|
|
@ -149,7 +149,9 @@ abstract class AbstractDataJpaRepositoriesAutoConfigurationTests {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private Map<Metamodel, JpaMetamodel> jpaMetamodelCache() {
|
private Map<Metamodel, JpaMetamodel> jpaMetamodelCache() {
|
||||||
return (Map<Metamodel, JpaMetamodel>) ReflectionTestUtils.getField(JpaMetamodel.class, "CACHE");
|
Object field = ReflectionTestUtils.getField(JpaMetamodel.class, "CACHE");
|
||||||
|
assertThat(field).isNotNull();
|
||||||
|
return (Map<Metamodel, JpaMetamodel>) field;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
|
|
Loading…
Reference in New Issue