tests for redirectHttp10Compatible

This commit is contained in:
Keith Donald
2008-05-13 15:00:10 +00:00
parent c175780324
commit b0fd959c94

View File

@@ -332,6 +332,25 @@ public class FlowHandlerAdapterTests extends TestCase {
EasyMock.verify(new Object[] { flowExecutor });
}
public void testLaunchFlowWithExternalRedirectNotHttp10Compatible() throws Exception {
flowHandlerAdapter.setRedirectHttp10Compatible(false);
request.setContextPath("/springtravel");
request.setServletPath("/app");
request.setPathInfo("/foo");
request.setRequestURI("/springtravel/app/foo");
request.setMethod("GET");
context.requestExternalRedirect("serverRelative:/bar");
flowExecutor.launchExecution("foo", flowInput, context);
FlowExecutionResult result = FlowExecutionResult.createPausedResult("foo", "12345");
EasyMock.expectLastCall().andReturn(result);
EasyMock.replay(new Object[] { flowExecutor });
flowHandlerAdapter.handle(request, response, flowHandler);
EasyMock.verify(new Object[] { flowExecutor });
assertEquals(303, response.getStatus());
assertEquals("/bar", response.getHeader("Location"));
EasyMock.verify(new Object[] { flowExecutor });
}
public void testDefaultHandleFlowException() throws Exception {
request.setContextPath("/springtravel");
request.setServletPath("/app");