verify(routeTester.jsonResponder()).respond(any(), any(RouteContext.class));
}
@Test
public void testFormParameters() throws Exception {
final RouteTester routeTester = RouteTester.from(new AbstractRoutingModule() {
@Override
public void configuration() {
route()
.from("/cars")
.on(RequestMethod.POST)
.produces(JSP)
.to(SampleController.class).save(param("color"), param("brand"));
}
}).requestMethod(POST).acceptHeader(HTML).param("color", "red").param("brand", "Ferrari");
routeTester.spyController(new SampleController());
final InvocationResult r = routeTester.process("/cars");
final Car car = (Car) r.getResult();
assertThat(car.getColor()).isEqualTo("red");
assertThat(car.getBrand()).isEqualTo("Ferrari");
verify(routeTester.jspResponder()).respond(any(), any(RouteContext.class));
}