use of org.springframework.web.reactive.result.method.RequestMappingInfo in project spring-framework by spring-projects.
the class RequestMappingHandlerMappingTests method getMappingOverridesConsumesFromTypeLevelAnnotation.
// SPR-14988
@Test
public void getMappingOverridesConsumesFromTypeLevelAnnotation() throws Exception {
RequestMappingInfo requestMappingInfo = assertComposedAnnotationMapping(RequestMethod.GET);
assertArrayEquals(new MediaType[] { MediaType.ALL }, new ArrayList<>(requestMappingInfo.getConsumesCondition().getConsumableMediaTypes()).toArray());
}
use of org.springframework.web.reactive.result.method.RequestMappingInfo in project spring-framework by spring-projects.
the class RequestMappingHandlerMappingTests method assertComposedAnnotationMapping.
private RequestMappingInfo assertComposedAnnotationMapping(String methodName, String path, RequestMethod requestMethod) throws Exception {
Class<?> clazz = ComposedAnnotationController.class;
Method method = clazz.getMethod(methodName);
RequestMappingInfo info = this.handlerMapping.getMappingForMethod(method, clazz);
assertNotNull(info);
Set<String> paths = info.getPatternsCondition().getPatterns();
assertEquals(1, paths.size());
assertEquals(path, paths.iterator().next());
Set<RequestMethod> methods = info.getMethodsCondition().getMethods();
assertEquals(1, methods.size());
assertEquals(requestMethod, methods.iterator().next());
return info;
}
use of org.springframework.web.reactive.result.method.RequestMappingInfo in project spring-framework by spring-projects.
the class RequestMappingHandlerMappingTests method resolveRequestMappingViaComposedAnnotation.
@Test
public void resolveRequestMappingViaComposedAnnotation() throws Exception {
RequestMappingInfo info = assertComposedAnnotationMapping("postJson", "/postJson", RequestMethod.POST);
assertEquals(MediaType.APPLICATION_JSON_VALUE, info.getConsumesCondition().getConsumableMediaTypes().iterator().next().toString());
assertEquals(MediaType.APPLICATION_JSON_VALUE, info.getProducesCondition().getProducibleMediaTypes().iterator().next().toString());
}
Aggregations