ManageCustomerController { @RequestMapping(value = "create", method = RequestMethod.POST, params = "redo") public String createRedo(CustomerForm form) { return "managecustomer/createForm"; }  @InitBinder("customerForm") void initBinder(WebDataBinder webDataBinder); @ModelAttribute CustomerForm setUpCustomerForm(); @RequestMapping(value = "create", method = RequestMethod.GET, params = "form") String createForm(); @RequestMapping(value = "create", method = RequestMethod.POST, params = "redo") String createRedo(CustomerForm form); @TransactionTokenCheck(value = "create", type = TransactionTokenType.BEGIN) @RequestMapping(value = "create", method = RequestMethod.POST, params = "confirm") String createConfirm(@Validated CustomerForm form,
            BindingResult result); @TransactionTokenCheck(value = "create", type = TransactionTokenType.IN) @RequestMapping(value = "create", method = RequestMethod.POST) String create(@Validated CustomerForm form, BindingResult result,
            RedirectAttributes redirectAttr); @RequestMapping(value = "create", method = RequestMethod.GET, params = "complete") String createComplete();  }
@Test public void testCreateRedo() { MockHttpServletRequestBuilder postRequest = MockMvcRequestBuilders.post( "/customers/create").param("redo", ""); CustomerForm form = prepareNewForm(); setFormForPost(form, postRequest); try { ResultActions results = mockMvc.perform(postRequest); results.andExpect(status().isOk()); results.andExpect(view().name("managecustomer/createForm")); CustomerForm backForm = (CustomerForm) results.andReturn() .getRequest().getAttribute("customerForm"); assertEquals(form.toString(), backForm.toString()); return; } catch (Exception e) { e.printStackTrace(); } fail(); }