public void testInvokerFilter() throws Exception
{
Resource1 r = new Resource1();
registry(r);
EnvironmentContext envctx = new EnvironmentContext();
HttpServletRequest httpRequest = new MockHttpServletRequest("/a/b", null, 0, "GET", null);
envctx.put(HttpServletRequest.class, httpRequest);
assertEquals(204, launcher.service("GET", "/a/b", "", null, null, envctx).getStatus());
httpRequest = new MockHttpServletRequest("/a", null, 0, "GET", null);
envctx.put(HttpServletRequest.class, httpRequest);
assertEquals(204, launcher.service("GET", "/a", "", null, null, envctx).getStatus());
providers.addMethodInvokerFilter(MethodInvokerFilter1.class);
httpRequest = new MockHttpServletRequest("/a/b", null, 0, "GET", null);
envctx.put(HttpServletRequest.class, httpRequest);
assertEquals(400, launcher.service("GET", "/a/b", "", null, null, envctx).getStatus());
httpRequest = new MockHttpServletRequest("/a", null, 0, "GET", null);
envctx.put(HttpServletRequest.class, httpRequest);
assertEquals(204, launcher.service("GET", "/a", "", null, null, envctx).getStatus());
unregistry(r);
}