Revise @Nullable declarations in the TestContext framework
This commit is contained in:
parent
d16fa82888
commit
c32ff17821
|
@ -113,7 +113,7 @@ public class MergedContextConfiguration implements Serializable {
|
||||||
* @param contextLoader the resolved {@code ContextLoader}
|
* @param contextLoader the resolved {@code ContextLoader}
|
||||||
*/
|
*/
|
||||||
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
||||||
@Nullable String[] activeProfiles, @Nullable ContextLoader contextLoader) {
|
@Nullable String[] activeProfiles, ContextLoader contextLoader) {
|
||||||
|
|
||||||
this(testClass, locations, classes, null, activeProfiles, contextLoader);
|
this(testClass, locations, classes, null, activeProfiles, contextLoader);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public class MergedContextConfiguration implements Serializable {
|
||||||
*/
|
*/
|
||||||
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
||||||
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
||||||
@Nullable String[] activeProfiles, @Nullable ContextLoader contextLoader) {
|
@Nullable String[] activeProfiles, ContextLoader contextLoader) {
|
||||||
|
|
||||||
this(testClass, locations, classes, contextInitializerClasses, activeProfiles, contextLoader, null, null);
|
this(testClass, locations, classes, contextInitializerClasses, activeProfiles, contextLoader, null, null);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ public class MergedContextConfiguration implements Serializable {
|
||||||
*/
|
*/
|
||||||
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
||||||
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
||||||
@Nullable String[] activeProfiles, @Nullable ContextLoader contextLoader,
|
@Nullable String[] activeProfiles, ContextLoader contextLoader,
|
||||||
@Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
@Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
||||||
@Nullable MergedContextConfiguration parent) {
|
@Nullable MergedContextConfiguration parent) {
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ public class MergedContextConfiguration implements Serializable {
|
||||||
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
public MergedContextConfiguration(Class<?> testClass, @Nullable String[] locations, @Nullable Class<?>[] classes,
|
||||||
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
||||||
@Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations,
|
@Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations,
|
||||||
@Nullable String[] propertySourceProperties, @Nullable ContextLoader contextLoader,
|
@Nullable String[] propertySourceProperties, ContextLoader contextLoader,
|
||||||
@Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
@Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
||||||
@Nullable MergedContextConfiguration parent) {
|
@Nullable MergedContextConfiguration parent) {
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ public class MergedContextConfiguration implements Serializable {
|
||||||
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
@Nullable Set<Class<? extends ApplicationContextInitializer<?>>> contextInitializerClasses,
|
||||||
@Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations,
|
@Nullable String[] activeProfiles, @Nullable String[] propertySourceLocations,
|
||||||
@Nullable String[] propertySourceProperties, @Nullable Set<ContextCustomizer> contextCustomizers,
|
@Nullable String[] propertySourceProperties, @Nullable Set<ContextCustomizer> contextCustomizers,
|
||||||
@Nullable ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
ContextLoader contextLoader, @Nullable CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate,
|
||||||
@Nullable MergedContextConfiguration parent) {
|
@Nullable MergedContextConfiguration parent) {
|
||||||
|
|
||||||
this.testClass = testClass;
|
this.testClass = testClass;
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class DefaultCacheAwareContextLoaderDelegate implements CacheAwareContext
|
||||||
*/
|
*/
|
||||||
static final ContextCache defaultContextCache = new DefaultContextCache();
|
static final ContextCache defaultContextCache = new DefaultContextCache();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private final AotTestMappings aotTestMappings = getAotTestMappings();
|
private final AotTestMappings aotTestMappings = getAotTestMappings();
|
||||||
|
|
||||||
private final ContextCache contextCache;
|
private final ContextCache contextCache;
|
||||||
|
@ -193,6 +194,7 @@ public class DefaultCacheAwareContextLoaderDelegate implements CacheAwareContext
|
||||||
return (this.aotTestMappings != null && this.aotTestMappings.isSupportedTestClass(testClass));
|
return (this.aotTestMappings != null && this.aotTestMappings.isSupportedTestClass(testClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private static AotTestMappings getAotTestMappings() {
|
private static AotTestMappings getAotTestMappings() {
|
||||||
if (AotDetector.useGeneratedArtifacts()) {
|
if (AotDetector.useGeneratedArtifacts()) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.support.GenericApplicationContext;
|
import org.springframework.context.support.GenericApplicationContext;
|
||||||
import org.springframework.core.Conventions;
|
import org.springframework.core.Conventions;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.test.context.TestContext;
|
import org.springframework.test.context.TestContext;
|
||||||
import org.springframework.test.context.aot.AotTestMappings;
|
import org.springframework.test.context.aot.AotTestMappings;
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(DependencyInjectionTestExecutionListener.class);
|
private static final Log logger = LogFactory.getLog(DependencyInjectionTestExecutionListener.class);
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private final AotTestMappings aotTestMappings = getAotTestMappings();
|
private final AotTestMappings aotTestMappings = getAotTestMappings();
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,6 +165,7 @@ public class DependencyInjectionTestExecutionListener extends AbstractTestExecut
|
||||||
return (this.aotTestMappings != null && this.aotTestMappings.isSupportedTestClass(testClass));
|
return (this.aotTestMappings != null && this.aotTestMappings.isSupportedTestClass(testClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private static AotTestMappings getAotTestMappings() {
|
private static AotTestMappings getAotTestMappings() {
|
||||||
if (AotDetector.useGeneratedArtifacts()) {
|
if (AotDetector.useGeneratedArtifacts()) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue