Search in sources :

Example 6 with RequestMappingHandlerMapping

use of org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping in project spring-framework by spring-projects.

the class DelegatingWebFluxConfigurationIntegrationTests method requestMappingHandlerMappingWithPrimaryUsesQualifiedRequestedContentTypeResolver.

@Test
void requestMappingHandlerMappingWithPrimaryUsesQualifiedRequestedContentTypeResolver() {
    load(registerPrimaryBean("testContentTypeResolver", RequestedContentTypeResolver.class));
    RequestMappingHandlerMapping handlerMapping = this.context.getBean(RequestMappingHandlerMapping.class);
    assertThat(handlerMapping.getContentTypeResolver()).isSameAs(this.context.getBean("webFluxContentTypeResolver"));
    assertThat(this.context.getBeansOfType(RequestedContentTypeResolver.class)).containsOnlyKeys("webFluxContentTypeResolver", "testContentTypeResolver");
}
Also used : RequestedContentTypeResolver(org.springframework.web.reactive.accept.RequestedContentTypeResolver) RequestMappingHandlerMapping(org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping) Test(org.junit.jupiter.api.Test)

Aggregations

RequestMappingHandlerMapping (org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping)6 Test (org.junit.jupiter.api.Test)4 Field (java.lang.reflect.Field)2 ApplicationContext (org.springframework.context.ApplicationContext)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 Bean (org.springframework.context.annotation.Bean)2 RequestedContentTypeResolver (org.springframework.web.reactive.accept.RequestedContentTypeResolver)2 PathPatternParser (org.springframework.web.util.pattern.PathPatternParser)2 Predicate (java.util.function.Predicate)1 HandlerMethod (org.springframework.web.method.HandlerMethod)1 RequestMappingInfo (org.springframework.web.reactive.result.method.RequestMappingInfo)1 ServerWebExchange (org.springframework.web.server.ServerWebExchange)1 MockServerWebExchange (org.springframework.web.testfixture.server.MockServerWebExchange)1