verify(routeTester.jspResponder()).respond(anyObject(), any(RouteContext.class));
}
@Test
public void testOnExceptions() throws Exception {
final RouteTester routeTester = RouteTester.from(new AbstractRoutingModule() {
@Override
public void configuration() throws Exception {
route()
.on(SampleControllerException.class, IllegalStateException.class)
.produces(JSP)
.to(SampleController.class).error(param(Exception.class));
route().from("/home").on(RequestMethod.GET, RequestMethod.POST).to(SampleController.class)
.throwSampleControllerException();
}
}).acceptHeader(MediaType.JSP).spyController(new SampleController());
routeTester.processGetRequest("/home");
verify(routeTester.<SampleController>getController()).error(any(IllegalArgumentException.class));
verify(routeTester.jspResponder()).respond(anyObject(), any(RouteContext.class));
verify(routeTester.jsonResponder(), never()).respond(anyObject(), any(RouteContext.class));
}