Move registerResourceIfNecessary() to ResourceHints
See gh-29083
This commit is contained in:
@@ -20,7 +20,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.support.RuntimeHintsUtils;
|
||||
import org.springframework.core.annotation.MergedAnnotations;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
@@ -101,7 +100,7 @@ class StandardTestRuntimeHints implements TestRuntimeHintsRegistrar {
|
||||
Arrays.stream(paths)
|
||||
.filter(path -> path.startsWith(CLASSPATH_URL_PREFIX))
|
||||
.map(resourceLoader::getResource)
|
||||
.forEach(resource -> RuntimeHintsUtils.registerResourceIfNecessary(runtimeHints, resource));
|
||||
.forEach(runtimeHints.resources()::registerResourceIfNecessary);
|
||||
}
|
||||
|
||||
private void registerClasspathResourceDirectoryStructure(String directory, RuntimeHints runtimeHints) {
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.support.RuntimeHintsUtils;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
@@ -397,7 +396,7 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
|
||||
Arrays.stream(paths)
|
||||
.filter(path -> path.startsWith(CLASSPATH_URL_PREFIX))
|
||||
.map(resourceLoader::getResource)
|
||||
.forEach(resource -> RuntimeHintsUtils.registerResourceIfNecessary(runtimeHints, resource));
|
||||
.forEach(runtimeHints.resources()::registerResourceIfNecessary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user