Search in sources :

Example 11 with CharacterEncodingFilter

use of org.springframework.web.filter.CharacterEncodingFilter in project dhis2-core by dhis2.

the class DhisWebSpringTest method setup.

@Before
public void setup() throws Exception {
    userService = _userService;
    CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
    characterEncodingFilter.setEncoding("UTF-8");
    characterEncodingFilter.setForceEncoding(true);
    mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).addFilters(characterEncodingFilter, new ShallowEtagHeaderFilter(), filterChainProxy).apply(documentationConfiguration(this.restDocumentation)).build();
    executeStartupRoutines();
    setUpTest();
}
Also used : CharacterEncodingFilter(org.springframework.web.filter.CharacterEncodingFilter) ShallowEtagHeaderFilter(org.springframework.web.filter.ShallowEtagHeaderFilter) Before(org.junit.Before)

Aggregations

CharacterEncodingFilter (org.springframework.web.filter.CharacterEncodingFilter)11 Test (org.junit.Test)7 Bean (org.springframework.context.annotation.Bean)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Before (org.junit.Before)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1 OrderedCharacterEncodingFilter (org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Order (org.springframework.core.annotation.Order)1 ShallowEtagHeaderFilter (org.springframework.web.filter.ShallowEtagHeaderFilter)1