Example usage for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setLocaleCharsetMappings

List of usage examples for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setLocaleCharsetMappings

Introduction

In this page you can find the example usage for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory setLocaleCharsetMappings.

Prototype

@Override
    public void setLocaleCharsetMappings(Map<Locale, Charset> localeCharsetMappings) 

Source Link

Usage

From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java

@Test
public void localeCharsetMappingsAreConfigured() throws Exception {
    AbstractServletWebServerFactory factory = getFactory();
    Map<Locale, Charset> mappings = new HashMap<>();
    mappings.put(Locale.GERMAN, Charset.forName("UTF-8"));
    factory.setLocaleCharsetMappings(mappings);
    this.webServer = factory.getWebServer();
    assertThat(getCharset(Locale.GERMAN).toString()).isEqualTo("UTF-8");
    assertThat(getCharset(Locale.ITALIAN)).isNull();
}