From 50599c5046d24d3ce8039dac261fbc9c8833e023 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 31 Oct 2022 16:03:49 +0100 Subject: [PATCH] Fix build Commit 29f085bd1a690ff7281e00b3a925e1160850ffbb in Spring Framework automatically registers hints for enclosing directories. This fixes the tests to expect hints for those directories as well. --- .../autoconfigure/web/WebResourcesRuntimeHintsTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java index cff3075fc6..f53e4b038f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java @@ -42,13 +42,14 @@ class WebResourcesRuntimeHintsTests { RuntimeHints hints = register( new TestClassLoader(List.of("META-INF/resources/", "resources/", "static/", "public/"))); assertThat(hints.resources().resourcePatternHints()).singleElement() - .satisfies(include("META-INF/resources/*", "resources/*", "static/*", "public/*")); + .satisfies(include("META-INF", "META-INF/resources", "META-INF/resources/*", "resources", "resources/*", + "static", "static/*", "public", "public/*")); } @Test void registerHintsWithOnlyStaticLocations() { RuntimeHints hints = register(new TestClassLoader(List.of("static/"))); - assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/*")); + assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static", "static/*")); } @Test @@ -66,7 +67,7 @@ class WebResourcesRuntimeHintsTests { private Consumer include(String... patterns) { return (hint) -> { - assertThat(hint.getIncludes()).map(ResourcePatternHint::getPattern).containsExactly(patterns); + assertThat(hint.getIncludes()).map(ResourcePatternHint::getPattern).containsExactlyInAnyOrder(patterns); assertThat(hint.getExcludes()).isEmpty(); }; }