mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Adapt to Spring Framework API change
This commit is contained in:
parent
d106fc266a
commit
4ffc421b3c
@ -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) {
|
||||
|
@ -44,7 +44,7 @@ class ConfigDataLocationRuntimeHintsTests {
|
||||
void registerWithDefaultSettings() {
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
new TestConfigDataLocationRuntimeHints().registerHints(hints, null);
|
||||
assertThat(hints.resources().resourcePatterns()).singleElement()
|
||||
assertThat(hints.resources().resourcePatternHints()).singleElement()
|
||||
.satisfies(includes("application*.properties", "application*.xml", "application*.yaml",
|
||||
"application*.yml", "config/application*.properties", "config/application*.xml",
|
||||
"config/application*.yaml", "config/application*.yml"));
|
||||
@ -60,7 +60,7 @@ class ConfigDataLocationRuntimeHintsTests {
|
||||
}
|
||||
|
||||
}.registerHints(hints, null);
|
||||
assertThat(hints.resources().resourcePatterns()).singleElement()
|
||||
assertThat(hints.resources().resourcePatternHints()).singleElement()
|
||||
.satisfies(includes("test*.properties", "test*.xml", "test*.yaml", "test*.yml",
|
||||
"config/test*.properties", "config/test*.xml", "config/test*.yaml", "config/test*.yml"));
|
||||
}
|
||||
@ -74,7 +74,7 @@ class ConfigDataLocationRuntimeHintsTests {
|
||||
return List.of("config/");
|
||||
}
|
||||
}.registerHints(hints, null);
|
||||
assertThat(hints.resources().resourcePatterns()).singleElement()
|
||||
assertThat(hints.resources().resourcePatternHints()).singleElement()
|
||||
.satisfies(includes("config/application*.properties", "config/application*.xml",
|
||||
"config/application*.yaml", "config/application*.yml"));
|
||||
}
|
||||
@ -88,7 +88,7 @@ class ConfigDataLocationRuntimeHintsTests {
|
||||
return List.of(".conf");
|
||||
}
|
||||
}.registerHints(hints, null);
|
||||
assertThat(hints.resources().resourcePatterns()).singleElement()
|
||||
assertThat(hints.resources().resourcePatternHints()).singleElement()
|
||||
.satisfies(includes("application*.conf", "config/application*.conf"));
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ class ConfigDataLocationRuntimeHintsTests {
|
||||
return List.of(UUID.randomUUID().toString());
|
||||
}
|
||||
}.registerHints(hints, null);
|
||||
assertThat(hints.resources().resourcePatterns()).isEmpty();
|
||||
assertThat(hints.resources().resourcePatternHints()).isEmpty();
|
||||
}
|
||||
|
||||
private Consumer<ResourcePatternHints> includes(String... patterns) {
|
||||
|
Loading…
Reference in New Issue
Block a user