From 0a6a6d48e2a0b5b6c08c065d542843ad8504b6cf Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 12 Apr 2021 20:14:48 +0100 Subject: [PATCH] Avoid CI failures with UTF-8 chars in test filenames See gh-26775 --- .../web/reactive/resource/ResourceWebHandlerTests.java | 2 +- .../web/reactive/resource/test/foo with spaces.css | 0 .../resource/ResourceHttpRequestHandlerIntegrationTests.java | 2 +- .../web/servlet/resource/test/foo with spaces.css | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename "spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/\321\204\320\276\320\276.css" => spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/foo with spaces.css (100%) rename "spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/\321\204\320\276\320\276.css" => spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/foo with spaces.css (100%) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java index 3c25602b2f52..5a84861847a1 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/resource/ResourceWebHandlerTests.java @@ -244,7 +244,7 @@ public void getResourceFromFileSystem() throws Exception { handler.afterPropertiesSet(); MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("")); - setPathWithinHandlerMapping(exchange, UriUtils.encodePath("test/фоо.css", UTF_8)); + setPathWithinHandlerMapping(exchange, UriUtils.encodePath("test/foo with spaces.css", UTF_8)); handler.handle(exchange).block(TIMEOUT); HttpHeaders headers = exchange.getResponse().getHeaders(); diff --git "a/spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/\321\204\320\276\320\276.css" b/spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/foo with spaces.css similarity index 100% rename from "spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/\321\204\320\276\320\276.css" rename to spring-webflux/src/test/resources/org/springframework/web/reactive/resource/test/foo with spaces.css diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerIntegrationTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerIntegrationTests.java index faf8f1dc0b82..1bff038dbd11 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerIntegrationTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandlerIntegrationTests.java @@ -88,7 +88,7 @@ void cssFile(boolean usePathPatterns, String pathPrefix) throws Exception { @ParameterizedTest @MethodSource("argumentSource") void classpathLocationWithEncodedPath(boolean usePathPatterns, String pathPrefix) throws Exception { - MockHttpServletRequest request = initRequest(pathPrefix + "/test/фоо.css"); + MockHttpServletRequest request = initRequest(pathPrefix + "/test/foo with spaces.css"); MockHttpServletResponse response = new MockHttpServletResponse(); DispatcherServlet servlet = initDispatcherServlet(usePathPatterns, WebConfig.class); diff --git "a/spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/\321\204\320\276\320\276.css" b/spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/foo with spaces.css similarity index 100% rename from "spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/\321\204\320\276\320\276.css" rename to spring-webmvc/src/test/resources/org/springframework/web/servlet/resource/test/foo with spaces.css