Search in sources :

Example 1 with RequestToViewNameTranslator

use of org.springframework.web.servlet.RequestToViewNameTranslator in project spring-framework by spring-projects.

the class WebMvcConfigurationSupportTests method defaultRequestToViewNameConfiguration.

@Test
public void defaultRequestToViewNameConfiguration() throws Exception {
    ApplicationContext context = initContext(WebConfig.class);
    RequestToViewNameTranslator requestToViewNameTranslator;
    requestToViewNameTranslator = context.getBean(REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME, RequestToViewNameTranslator.class);
    assertThat(requestToViewNameTranslator).isNotNull();
    assertThat(requestToViewNameTranslator).isInstanceOf(DefaultRequestToViewNameTranslator.class);
}
Also used : AnnotationConfigWebApplicationContext(org.springframework.web.context.support.AnnotationConfigWebApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) DefaultRequestToViewNameTranslator(org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator) RequestToViewNameTranslator(org.springframework.web.servlet.RequestToViewNameTranslator) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ApplicationContext (org.springframework.context.ApplicationContext)1 AnnotationConfigWebApplicationContext (org.springframework.web.context.support.AnnotationConfigWebApplicationContext)1 RequestToViewNameTranslator (org.springframework.web.servlet.RequestToViewNameTranslator)1 DefaultRequestToViewNameTranslator (org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator)1