Search in sources :

Example 1 with ServletWebArgumentResolverAdapter

use of org.springframework.web.servlet.mvc.method.annotation.ServletWebArgumentResolverAdapter in project spring-framework by spring-projects.

the class TestPathHelper method testArgumentResolvers.

private void testArgumentResolvers(Object bean) {
    assertNotNull(bean);
    Object value = new DirectFieldAccessor(bean).getPropertyValue("customArgumentResolvers");
    assertNotNull(value);
    assertTrue(value instanceof List);
    @SuppressWarnings("unchecked") List<HandlerMethodArgumentResolver> resolvers = (List<HandlerMethodArgumentResolver>) value;
    assertEquals(3, resolvers.size());
    assertTrue(resolvers.get(0) instanceof ServletWebArgumentResolverAdapter);
    assertTrue(resolvers.get(1) instanceof TestHandlerMethodArgumentResolver);
    assertTrue(resolvers.get(2) instanceof TestHandlerMethodArgumentResolver);
    assertNotSame(resolvers.get(1), resolvers.get(2));
}
Also used : DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) List(java.util.List) ServletWebArgumentResolverAdapter(org.springframework.web.servlet.mvc.method.annotation.ServletWebArgumentResolverAdapter) HandlerMethodArgumentResolver(org.springframework.web.method.support.HandlerMethodArgumentResolver)

Aggregations

List (java.util.List)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 HandlerMethodArgumentResolver (org.springframework.web.method.support.HandlerMethodArgumentResolver)1 ServletWebArgumentResolverAdapter (org.springframework.web.servlet.mvc.method.annotation.ServletWebArgumentResolverAdapter)1