@Test
public void testDelegatingActionForm() throws Exception
{
ServletActionContext sac = getActionContext();
FormWrapper wrapper = newMock(FormWrapper.class);
ProcessActionForm processActionForm = getProcessActionForm(wrapper);
HttpServletRequest request = newMock(HttpServletRequest.class);
ActionForm actionForm = newMock(ActionForm.class);
DelegatingForm delegatingForm = new DelegatingForm(actionForm);
expect(sac.getActionForm()).andReturn(actionForm);
expect(sac.getRequest()).andReturn(request);
expect(wrapper.wrapForm(actionForm, request)).andReturn(delegatingForm);
wrapper.handleBindingForm(isA(BindingForm.class), eq(request));
wrapper.handleValidForm(isA(ValidForm.class), eq(request));
sac.setActionForm(isA(ActionForm.class));
replayMocks();
processActionForm.execute(sac);
verifyMocks();