public void testHttpMethodController3() {
Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
controllerClasses.add(TestHttpMethodController3.class);
FakeRouteMap rm = new FakeRouteMap();
ControllerDatabase db = new MappedControllerDatabase(controllerClasses, rm,
new HashMap<String, EntityMarshaller>());
assertEquals(TestHttpMethodController3.class, db.getControllerClass("TestHttpMethodController3"));
ActionSignature sig = db.getHttpMethodActionSignature(TestHttpMethodController3.class, HttpMethod.GET);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("multiAction", sig.methodName());
List<Class<?>> interceptors = db.getInterceptorsForHttpMethodAction(TestHttpMethodController3.class,
HttpMethod.GET);
assertNotNull(interceptors);
assertEquals(2, interceptors.size());
assertEquals(Interceptor1.class, interceptors.get(0));
assertEquals(Interceptor2.class, interceptors.get(1));
sig = db.getHttpMethodActionSignature(TestHttpMethodController3.class, HttpMethod.POST);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("multiAction", sig.methodName());
interceptors = db.getInterceptorsForHttpMethodAction(TestHttpMethodController3.class, HttpMethod.POST);
assertNotNull(interceptors);
assertEquals(2, interceptors.size());
assertEquals(Interceptor1.class, interceptors.get(0));
assertEquals(Interceptor2.class, interceptors.get(1));
sig = db.getHttpMethodActionSignature(TestHttpMethodController3.class, HttpMethod.PUT);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("multiAction", sig.methodName());
interceptors = db.getInterceptorsForHttpMethodAction(TestHttpMethodController3.class, HttpMethod.PUT);
assertNotNull(interceptors);
assertEquals(2, interceptors.size());
assertEquals(Interceptor1.class, interceptors.get(0));
assertEquals(Interceptor2.class, interceptors.get(1));