ReserveTourController { @RequestMapping(value = "{tourCode}/reserve", method = RequestMethod.POST, params = "redo") public String reserveRedo( @AuthenticationPrincipal ReservationUserDetails userDetails, @PathVariable("tourCode") String tourCode, ReserveTourForm form, Model model) { return reserveForm(userDetails, tourCode, form, model); }  @ModelAttribute ReserveTourForm setUpReserveTourForm(); @RequestMapping(value = { "{tourCode}", "{tourCode}/reserve" }, method = RequestMethod.GET, params = "form") String reserveForm(
            @AuthenticationPrincipal ReservationUserDetails userDetails,
            @PathVariable("tourCode") String tourCode, ReserveTourForm form,
            Model model); @TransactionTokenCheck(value = "reserve", type = TransactionTokenType.BEGIN) @RequestMapping(value = "{tourCode}/reserve", method = RequestMethod.POST, params = "confirm") String confirm(
            @AuthenticationPrincipal ReservationUserDetails userDetails,
            @PathVariable("tourCode") String tourCode,
            @Validated ReserveTourForm form, BindingResult bindingResult,
            Model model); @TransactionTokenCheck(value = "reserve", type = TransactionTokenType.IN) @RequestMapping(value = "{tourCode}/reserve", method = RequestMethod.POST) String reserve(
            @AuthenticationPrincipal ReservationUserDetails userDetails,
            @PathVariable("tourCode") String tourCode,
            @Validated ReserveTourForm form, BindingResult bindingResult,
            Model model, RedirectAttributes redirectAttr); @RequestMapping(value = "{tourCode}/reserve", method = RequestMethod.GET, params = "complete") String reserveComplete(); @RequestMapping(value = "{tourCode}/reserve", method = RequestMethod.POST, params = "redo") String reserveRedo(
            @AuthenticationPrincipal ReservationUserDetails userDetails,
            @PathVariable("tourCode") String tourCode, ReserveTourForm form,
            Model model);  }
@Test public void testReserveRedo() { MockHttpServletRequestBuilder postRequest = MockMvcRequestBuilders.post( "/tours/123/reserve").param("redo", ""); try { ResultActions results = mockMvc.perform(postRequest); results.andExpect(status().isOk()); results.andExpect(view().name("reservetour/reserveForm")); return; } catch (Exception e) { e.printStackTrace(); } fail(); }