|
27 | 27 | import java.util.HashMap;
|
28 | 28 | import java.util.Locale;
|
29 | 29 | import java.util.Map;
|
| 30 | +import java.util.Properties; |
30 | 31 | import java.util.concurrent.Future;
|
31 | 32 | import java.util.concurrent.atomic.AtomicReference;
|
32 | 33 |
|
|
80 | 81 | import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory;
|
81 | 82 | import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests;
|
82 | 83 | import org.springframework.core.io.ByteArrayResource;
|
| 84 | +import org.springframework.core.io.ClassPathResource; |
| 85 | +import org.springframework.core.io.support.PropertiesLoaderUtils; |
83 | 86 | import org.springframework.http.HttpEntity;
|
84 | 87 | import org.springframework.http.HttpHeaders;
|
85 | 88 | import org.springframework.http.HttpStatus;
|
@@ -405,13 +408,15 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
|
405 | 408 | }
|
406 | 409 |
|
407 | 410 | @Test
|
408 |
| - void defaultLocaleCharsetMappingsAreOverridden() { |
| 411 | + void defaultLocaleCharsetMappingsAreOverridden() throws IOException { |
409 | 412 | TomcatServletWebServerFactory factory = getFactory();
|
410 | 413 | this.webServer = factory.getWebServer();
|
411 | 414 | // override defaults, see org.apache.catalina.util.CharsetMapperDefault.properties
|
412 |
| - assertThat(getCharset(Locale.ENGLISH)).isEqualTo(StandardCharsets.UTF_8); |
413 |
| - assertThat(getCharset(Locale.FRENCH)).isEqualTo(StandardCharsets.UTF_8); |
414 |
| - assertThat(getCharset(Locale.JAPANESE)).isEqualTo(StandardCharsets.UTF_8); |
| 415 | + Properties charsetMapperDefault = PropertiesLoaderUtils |
| 416 | + .loadProperties(new ClassPathResource("CharsetMapperDefault.properties", CharsetMapper.class)); |
| 417 | + for (String language : charsetMapperDefault.stringPropertyNames()) { |
| 418 | + assertThat(getCharset(new Locale(language))).isEqualTo(StandardCharsets.UTF_8); |
| 419 | + } |
415 | 420 | }
|
416 | 421 |
|
417 | 422 | @Test
|
|
0 commit comments