assertNull(mv);
EasyMock.verify(new Object[] { executor });
}
public void testHandleFlowOutcomeCustomFlowHandler() throws Exception {
final LocalAttributeMap input = new LocalAttributeMap();
input.put("bar", "boop");
controller.registerFlowHandler(new FlowHandler() {
public String getFlowId() {
return "foo";
}
public MutableAttributeMap createExecutionInputMap(HttpServletRequest request) {
return input;
}
public String handleExecutionOutcome(FlowExecutionOutcome outcome, HttpServletRequest request,
HttpServletResponse response) {
assertEquals("finish", outcome.getId());
assertEquals("baz", outcome.getOutput().get("bar"));
assertEquals(FlowControllerTests.this.request, request);
assertEquals(FlowControllerTests.this.response, response);
return null;
}
public String handleException(FlowException e, HttpServletRequest request, HttpServletResponse response) {
return null;
}
});
request.setContextPath("/springtravel");
request.setServletPath("/app");
request.setPathInfo("/foo");
request.setRequestURI("/springtravel/app/foo");
request.setMethod("GET");
executor.launchExecution("foo", input, context);
LocalAttributeMap output = new LocalAttributeMap();
output.put("bar", "baz");
FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output);
FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome);
EasyMock.expectLastCall().andReturn(result);
EasyMock.replay(new Object[] { executor });
ModelAndView mv = controller.handleRequest(request, response);