use of org.springframework.web.servlet.handler.AbstractHandlerMapping in project spring-framework by spring-projects.
the class DelegatingWebMvcConfigurationIntegrationTests method viewControllerHandlerMappingUsesMvcInfrastructureByDefault.
@Test
void viewControllerHandlerMappingUsesMvcInfrastructureByDefault() {
load(context -> context.registerBean(ViewControllerConfiguration.class));
AbstractHandlerMapping handlerMapping = this.context.getBean("viewControllerHandlerMapping", AbstractHandlerMapping.class);
assertThat(handlerMapping.getPathMatcher()).isSameAs(this.context.getBean("mvcPathMatcher"));
assertThat(handlerMapping.getUrlPathHelper()).isSameAs(this.context.getBean("mvcUrlPathHelper"));
}
use of org.springframework.web.servlet.handler.AbstractHandlerMapping in project spring-framework by spring-projects.
the class DelegatingWebMvcConfigurationIntegrationTests method resourceHandlerMappingWithPrimaryUsesQualifiedPathMatcher.
@Test
void resourceHandlerMappingWithPrimaryUsesQualifiedPathMatcher() {
load(registerPrimaryBean("testPathMatcher", PathMatcher.class).andThen(context -> context.registerBean(ResourceHandlerConfiguration.class)));
AbstractHandlerMapping handlerMapping = this.context.getBean("resourceHandlerMapping", AbstractHandlerMapping.class);
assertThat(handlerMapping.getPathMatcher()).isSameAs(this.context.getBean("mvcPathMatcher"));
assertThat(this.context.getBeansOfType(PathMatcher.class)).containsOnlyKeys("mvcPathMatcher", "testPathMatcher");
}
Aggregations