|
17 | 17 | package org.springframework.test.context.aot;
|
18 | 18 |
|
19 | 19 | import java.util.Arrays;
|
20 |
| -import java.util.HashSet; |
21 | 20 | import java.util.LinkedHashSet;
|
22 | 21 | import java.util.List;
|
23 | 22 | import java.util.Map;
|
@@ -179,27 +178,18 @@ public void processAheadOfTime(Stream<Class<?>> testClasses) throws TestContextA
|
179 | 178 |
|
180 | 179 | MultiValueMap<MergedContextConfiguration, Class<?>> mergedConfigMappings = new LinkedMultiValueMap<>();
|
181 | 180 | ClassLoader classLoader = getClass().getClassLoader();
|
182 |
| - Set<String> visitedTestClassNames = new HashSet<>(); |
183 | 181 | 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())); |
201 | 190 | }
|
202 |
| - } |
| 191 | + registrar.registerHints(this.runtimeHints, testClass, classLoader); |
| 192 | + }); |
203 | 193 | });
|
204 | 194 |
|
205 | 195 | coreRuntimeHintsRegistrarClasses.stream()
|
|
0 commit comments