Revise method signature in TestRuntimeHintsRegistrar

This commit is contained in:
Sam Brannen 2022-09-05 12:01:03 +02:00
parent 16ff05ed86
commit c2dd6667f1
3 changed files with 7 additions and 7 deletions

View File

@ -120,8 +120,8 @@ public class TestContextAotGenerator {
logger.debug(LogMessage.format("Generating AOT artifacts for test classes %s", logger.debug(LogMessage.format("Generating AOT artifacts for test classes %s",
testClasses.stream().map(Class::getName).toList())); testClasses.stream().map(Class::getName).toList()));
try { try {
this.testRuntimeHintsRegistrars.forEach(registrar -> registrar.registerHints(this.runtimeHints, this.testRuntimeHintsRegistrars.forEach(registrar -> registrar.registerHints(mergedConfig,
mergedConfig, Collections.unmodifiableList(testClasses), getClass().getClassLoader())); Collections.unmodifiableList(testClasses), this.runtimeHints, getClass().getClassLoader()));
// Use first test class discovered for a given unique MergedContextConfiguration. // Use first test class discovered for a given unique MergedContextConfiguration.
Class<?> testClass = testClasses.get(0); Class<?> testClass = testClasses.get(0);

View File

@ -45,13 +45,13 @@ public interface TestRuntimeHintsRegistrar {
/** /**
* Contribute hints to the given {@link RuntimeHints} instance. * Contribute hints to the given {@link RuntimeHints} instance.
* @param runtimeHints the {@code RuntimeHints} to use
* @param mergedConfig the merged context configuration to process * @param mergedConfig the merged context configuration to process
* @param testClasses the test classes that share the supplied merged context * @param testClasses the test classes that share the supplied merged context
* configuration * configuration
* @param runtimeHints the {@code RuntimeHints} to use
* @param classLoader the classloader to use * @param classLoader the classloader to use
*/ */
void registerHints(RuntimeHints runtimeHints, MergedContextConfiguration mergedConfig, void registerHints(MergedContextConfiguration mergedConfig, List<Class<?>> testClasses,
List<Class<?>> testClasses, ClassLoader classLoader); RuntimeHints runtimeHints, ClassLoader classLoader);
} }

View File

@ -47,8 +47,8 @@ class StandardTestRuntimeHints implements TestRuntimeHintsRegistrar {
@Override @Override
public void registerHints(RuntimeHints runtimeHints, MergedContextConfiguration mergedConfig, public void registerHints(MergedContextConfiguration mergedConfig, List<Class<?>> testClasses,
List<Class<?>> testClasses, ClassLoader classLoader) { RuntimeHints runtimeHints, ClassLoader classLoader) {
registerHintsForMergedContextConfiguration(runtimeHints, mergedConfig); registerHintsForMergedContextConfiguration(runtimeHints, mergedConfig);
testClasses.forEach(testClass -> registerHintsForActiveProfilesResolvers(runtimeHints, testClass)); testClasses.forEach(testClass -> registerHintsForActiveProfilesResolvers(runtimeHints, testClass));