Adapt to Spring Framework API change

This commit is contained in:
Stephane Nicoll
2022-10-06 09:58:05 +02:00
parent d106fc266a
commit 4ffc421b3c
2 changed files with 8 additions and 8 deletions

View File

@@ -40,20 +40,20 @@ class WebResourcesRuntimeHintsTests {
void registerHintsWithAllLocations() {
RuntimeHints hints = register(
new TestClassLoader(List.of("META-INF/resources/", "resources/", "static/", "public/")));
assertThat(hints.resources().resourcePatterns()).singleElement()
assertThat(hints.resources().resourcePatternHints()).singleElement()
.satisfies(include("META-INF/resources/*", "resources/*", "static/*", "public/*"));
}
@Test
void registerHintsWithOnlyStaticLocations() {
RuntimeHints hints = register(new TestClassLoader(List.of("static/")));
assertThat(hints.resources().resourcePatterns()).singleElement().satisfies(include("static/*"));
assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/*"));
}
@Test
void registerHintsWithNoLocation() {
RuntimeHints hints = register(new TestClassLoader(List.of()));
assertThat(hints.resources().resourcePatterns()).isEmpty();
assertThat(hints.resources().resourcePatternHints()).isEmpty();
}
private RuntimeHints register(ClassLoader classLoader) {