use of org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver in project spring-framework by spring-projects.
the class ControllerMethodResolverTests method exceptionHandlerArgumentResolvers.
@Test
public void exceptionHandlerArgumentResolvers() {
InvocableHandlerMethod invocable = this.methodResolver.getExceptionHandlerMethod(new ResponseStatusException(HttpStatus.BAD_REQUEST, "reason"), this.handlerMethod);
assertThat(invocable).as("No match").isNotNull();
assertThat(invocable.getBeanType()).isEqualTo(TestController.class);
List<HandlerMethodArgumentResolver> resolvers = invocable.getResolvers();
AtomicInteger index = new AtomicInteger(-1);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestParamMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestParamMapMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(PathVariableMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(PathVariableMapMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(MatrixVariableMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(MatrixVariableMapMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestHeaderMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestHeaderMapMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(CookieValueMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(ExpressionValueMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(SessionAttributeMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestAttributeMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(ModelMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(ServerWebExchangeMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(PrincipalMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(WebSessionMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(ContinuationHandlerMethodArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(CustomArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(CustomSyncArgumentResolver.class);
assertThat(next(resolvers, index).getClass()).isEqualTo(RequestParamMethodArgumentResolver.class);
}
Aggregations