Skip to content

Commit

Permalink
Adapt to removal of static resource location filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Nov 10, 2021
1 parent 85e0643 commit f3b5e6b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.io.ClassPathResource;
import org.springframework.format.Parser;
import org.springframework.format.Printer;
import org.springframework.format.support.FormattingConversionService;
Expand Down Expand Up @@ -150,13 +151,12 @@ void shouldRegisterResourceHandlerMapping() {
SimpleUrlHandlerMapping hm = context.getBean("resourceHandlerMapping", SimpleUrlHandlerMapping.class);
assertThat(hm.getUrlMap().get("/**")).isInstanceOf(ResourceWebHandler.class);
ResourceWebHandler staticHandler = (ResourceWebHandler) hm.getUrlMap().get("/**");
assertThat(staticHandler).extracting("locationValues").asList().hasSize(4);
assertThat(staticHandler.getLocations()).hasSize(1);
assertThat(staticHandler.getLocations().get(0)).hasToString("class path resource [public/]");
assertThat(staticHandler.getLocations()).hasSize(4);
assertThat(hm.getUrlMap().get("/webjars/**")).isInstanceOf(ResourceWebHandler.class);
ResourceWebHandler webjarsHandler = (ResourceWebHandler) hm.getUrlMap().get("/webjars/**");
assertThat(webjarsHandler).extracting("locationValues").asList()
.containsExactly("classpath:/META-INF/resources/webjars/");
assertThat(webjarsHandler.getLocations()).hasSize(1);
assertThat(webjarsHandler.getLocations().get(0))
.isEqualTo(new ClassPathResource("/META-INF/resources/webjars/"));
});
}

Expand Down

0 comments on commit f3b5e6b

Please sign in to comment.