Merge branch '6.0.x'
This commit is contained in:
commit
15b6626a4c
|
|
@ -46,7 +46,6 @@ import org.springframework.context.support.GenericApplicationContext;
|
||||||
import org.springframework.core.annotation.MergedAnnotation;
|
import org.springframework.core.annotation.MergedAnnotation;
|
||||||
import org.springframework.core.annotation.MergedAnnotations;
|
import org.springframework.core.annotation.MergedAnnotations;
|
||||||
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
||||||
import org.springframework.core.log.LogMessage;
|
|
||||||
import org.springframework.javapoet.ClassName;
|
import org.springframework.javapoet.ClassName;
|
||||||
import org.springframework.test.context.BootstrapUtils;
|
import org.springframework.test.context.BootstrapUtils;
|
||||||
import org.springframework.test.context.ContextLoadException;
|
import org.springframework.test.context.ContextLoadException;
|
||||||
|
|
@ -195,8 +194,10 @@ public class TestContextAotGenerator {
|
||||||
ClassLoader classLoader = getClass().getClassLoader();
|
ClassLoader classLoader = getClass().getClassLoader();
|
||||||
MultiValueMap<ClassName, Class<?>> initializerClassMappings = new LinkedMultiValueMap<>();
|
MultiValueMap<ClassName, Class<?>> initializerClassMappings = new LinkedMultiValueMap<>();
|
||||||
mergedConfigMappings.forEach((mergedConfig, testClasses) -> {
|
mergedConfigMappings.forEach((mergedConfig, testClasses) -> {
|
||||||
logger.debug(LogMessage.format("Generating AOT artifacts for test classes %s",
|
if (logger.isDebugEnabled()) {
|
||||||
testClasses.stream().map(Class::getName).toList()));
|
logger.debug("Generating AOT artifacts for test classes " +
|
||||||
|
testClasses.stream().map(Class::getName).toList());
|
||||||
|
}
|
||||||
this.mergedConfigRuntimeHints.registerHints(this.runtimeHints, mergedConfig, classLoader);
|
this.mergedConfigRuntimeHints.registerHints(this.runtimeHints, mergedConfig, classLoader);
|
||||||
try {
|
try {
|
||||||
// Use first test class discovered for a given unique MergedContextConfiguration.
|
// Use first test class discovered for a given unique MergedContextConfiguration.
|
||||||
|
|
@ -209,8 +210,16 @@ public class TestContextAotGenerator {
|
||||||
generationContext.writeGeneratedContent();
|
generationContext.writeGeneratedContent();
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
logger.warn(LogMessage.format("Failed to generate AOT artifacts for test classes %s",
|
if (logger.isDebugEnabled()) {
|
||||||
testClasses.stream().map(Class::getName).toList()), ex);
|
logger.debug("Failed to generate AOT artifacts for test classes " +
|
||||||
|
testClasses.stream().map(Class::getName).toList(), ex);
|
||||||
|
}
|
||||||
|
else if (logger.isWarnEnabled()) {
|
||||||
|
logger.warn("""
|
||||||
|
Failed to generate AOT artifacts for test classes %s. \
|
||||||
|
Enable DEBUG logging to view the stack trace. %s"""
|
||||||
|
.formatted(testClasses.stream().map(Class::getName).toList(), ex));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return initializerClassMappings;
|
return initializerClassMappings;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue