When using AnnotationMethodHandlerAdapter with Mock request and response to test controller mappings and controller under test has class- and method-level @RequestMapping annotation - receiving an NPE. I have to manually put some attribute to the request. Please see the test from URL for details. The bug root case is null unsafe useTypeLevelMapping method at AMHA. I propose to change the return to something which is close to useSuffixPattern method return. Like "
Object value = request.getAttribute(HandlerMapping.INTROSPECT_TYPE_LEVEL_MAPPING);
return (value != null) ? (Boolean) value : Boolean.TRUE;
Thanks for the link! Added to my pet-project. But on my mind for this particular type of tests AMHA is just enough because spring-test-mvc even in standalone mode creates a real context which makes test quite heavy. Also in standalone mode you should somehow inject your services which is easier with specific test context.