public void testHttpMethodController() {
Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
controllerClasses.add(TestHttpMethodController.class);
FakeRouteMap rm = new FakeRouteMap();
ControllerDatabase db = new MappedControllerDatabase(controllerClasses, rm,
new HashMap<String, EntityMarshaller>());
assertEquals(TestHttpMethodController.class, db.getControllerClass("TestHttpMethodController"));
ActionSignature sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.GET);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("getAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.POST);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("postAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.PUT);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("putAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.DELETE);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("deleteAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.OPTIONS);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("optionsAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.HEAD);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("headAction", sig.methodName());
sig = db.getHttpMethodActionSignature(TestHttpMethodController.class, HttpMethod.TRACE);
assertNotNull(sig);
assertTrue(sig instanceof HttpMethodActionSignature);
assertEquals("traceAction", sig.methodName());
assertEquals(1, rm.size());