Search in sources :

Example 1 with MockMvcConfigurer

use of org.springframework.test.web.servlet.setup.MockMvcConfigurer in project spring-boot by spring-projects.

the class MvcEndpointIntegrationTests method doCreateMockMvc.

private MockMvc doCreateMockMvc(MockMvcConfigurer... configurers) {
    this.context.setServletContext(new MockServletContext());
    this.context.refresh();
    DefaultMockMvcBuilder builder = MockMvcBuilders.webAppContextSetup(this.context);
    for (MockMvcConfigurer configurer : configurers) {
        builder.apply(configurer);
    }
    return builder.build();
}
Also used : DefaultMockMvcBuilder(org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder) MockMvcConfigurer(org.springframework.test.web.servlet.setup.MockMvcConfigurer) MockServletContext(org.springframework.mock.web.MockServletContext)

Aggregations

MockServletContext (org.springframework.mock.web.MockServletContext)1 DefaultMockMvcBuilder (org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder)1 MockMvcConfigurer (org.springframework.test.web.servlet.setup.MockMvcConfigurer)1