Skip to content

Commit f72bf0c

Browse files
committed
Revert "Skipping duplicate test classes during test AOT processing"
This reverts commit 1281f03.
1 parent 563112c commit f72bf0c

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

spring-test/src/main/java/org/springframework/test/context/aot/TestContextAotGenerator.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.springframework.test.context.aot;
1818

1919
import java.util.Arrays;
20-
import java.util.HashSet;
2120
import java.util.LinkedHashSet;
2221
import java.util.List;
2322
import java.util.Map;
@@ -179,27 +178,18 @@ public void processAheadOfTime(Stream<Class<?>> testClasses) throws TestContextA
179178

180179
MultiValueMap<MergedContextConfiguration, Class<?>> mergedConfigMappings = new LinkedMultiValueMap<>();
181180
ClassLoader classLoader = getClass().getClassLoader();
182-
Set<String> visitedTestClassNames = new HashSet<>();
183181
testClasses.forEach(testClass -> {
184-
String testClassName = testClass.getName();
185-
if (visitedTestClassNames.add(testClassName)) {
186-
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass);
187-
mergedConfigMappings.add(mergedConfig, testClass);
188-
collectRuntimeHintsRegistrarClasses(testClass, coreRuntimeHintsRegistrarClasses);
189-
reflectiveRuntimeHintsRegistrar.registerRuntimeHints(this.runtimeHints, testClass);
190-
this.testRuntimeHintsRegistrars.forEach(registrar -> {
191-
if (logger.isTraceEnabled()) {
192-
logger.trace("Processing RuntimeHints contribution from class [%s]"
193-
.formatted(registrar.getClass().getCanonicalName()));
194-
}
195-
registrar.registerHints(this.runtimeHints, testClass, classLoader);
196-
});
197-
}
198-
else {
199-
if (logger.isDebugEnabled()) {
200-
logger.debug("Skipping duplicate test class: " + testClassName);
182+
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration(testClass);
183+
mergedConfigMappings.add(mergedConfig, testClass);
184+
collectRuntimeHintsRegistrarClasses(testClass, coreRuntimeHintsRegistrarClasses);
185+
reflectiveRuntimeHintsRegistrar.registerRuntimeHints(this.runtimeHints, testClass);
186+
this.testRuntimeHintsRegistrars.forEach(registrar -> {
187+
if (logger.isTraceEnabled()) {
188+
logger.trace("Processing RuntimeHints contribution from class [%s]"
189+
.formatted(registrar.getClass().getCanonicalName()));
201190
}
202-
}
191+
registrar.registerHints(this.runtimeHints, testClass, classLoader);
192+
});
203193
});
204194

205195
coreRuntimeHintsRegistrarClasses.stream()

0 commit comments

Comments
 (0)