Revert "Skipping duplicate test classes during test AOT processing"
This reverts commit 1281f03b96.
This commit is contained in:
parent
563112c1b7
commit
f72bf0c177
|
|
@ -17,7 +17,6 @@
|
|||
package org.springframework.test.context.aot;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -179,27 +178,18 @@ public class TestContextAotGenerator {
|
|||
|
||||
MultiValueMap<MergedContextConfiguration, Class<?>> mergedConfigMappings = new LinkedMultiValueMap<>();
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
Set<String> visitedTestClassNames = new HashSet<>();
|
||||
testClasses.forEach(testClass -> {
|
||||
String testClassName = testClass.getName();
|
||||
if (visitedTestClassNames.add(testClassName)) {
|
||||
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass);
|
||||
mergedConfigMappings.add(mergedConfig, testClass);
|
||||
collectRuntimeHintsRegistrarClasses(testClass, coreRuntimeHintsRegistrarClasses);
|
||||
reflectiveRuntimeHintsRegistrar.registerRuntimeHints(this.runtimeHints, testClass);
|
||||
this.testRuntimeHintsRegistrars.forEach(registrar -> {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Processing RuntimeHints contribution from class [%s]"
|
||||
.formatted(registrar.getClass().getCanonicalName()));
|
||||
}
|
||||
registrar.registerHints(this.runtimeHints, testClass, classLoader);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Skipping duplicate test class: " + testClassName);
|
||||
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass);
|
||||
mergedConfigMappings.add(mergedConfig, testClass);
|
||||
collectRuntimeHintsRegistrarClasses(testClass, coreRuntimeHintsRegistrarClasses);
|
||||
reflectiveRuntimeHintsRegistrar.registerRuntimeHints(this.runtimeHints, testClass);
|
||||
this.testRuntimeHintsRegistrars.forEach(registrar -> {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Processing RuntimeHints contribution from class [%s]"
|
||||
.formatted(registrar.getClass().getCanonicalName()));
|
||||
}
|
||||
}
|
||||
registrar.registerHints(this.runtimeHints, testClass, classLoader);
|
||||
});
|
||||
});
|
||||
|
||||
coreRuntimeHintsRegistrarClasses.stream()
|
||||
|
|
|
|||
Loading…
Reference in New Issue