ReserveTourHelper { public TourDetailOutput findTourDetail(ReservationUserDetails userDetails, String tourCode, ReserveTourForm form) { TourInfo tourInfo = tourInfoSharedService.findOne(tourCode); PriceCalculateOutput priceCalculateOutput = priceCalculateService .calculatePrice(tourInfo.getBasePrice(), form.getAdultCount(), form.getChildCount()); TourDetailOutput output = new TourDetailOutput(); output.setTourInfo(tourInfo); output.setPriceCalculateOutput(priceCalculateOutput); if (userDetails != null) { output.setCustomer(userDetails.getCustomer()); } return output; }  TourDetailOutput findTourDetail(ReservationUserDetails userDetails,
            String tourCode, ReserveTourForm form); ReserveTourOutput reserve(ReservationUserDetails userDetails,
            String tourCode,
            ReserveTourForm tourReserveForm);  }
@Test public void testFindTourDetail01() { String tourCode = "xxxxx"; ReserveTourForm form = new ReserveTourForm(); form.setAdultCount(1); form.setChildCount(2); TourDetailOutput resultOutput = reserveHelper.findTourDetail( userDetails, tourCode, form); assertThat(resultOutput.getCustomer(), is(customer)); assertThat(resultOutput.getPriceCalculateOutput(), is( priceCalculateOutput)); assertThat(resultOutput.getTourInfo(), is(tourInfo)); }
@Test public void testFindTourDetail02() { String tourCode = "xxxxx"; ReserveTourForm form = new ReserveTourForm(); form.setAdultCount(1); form.setChildCount(2); TourDetailOutput resultOutput = reserveHelper.findTourDetail(null, tourCode, form); assertThat(resultOutput.getCustomer(), is(nullValue())); assertThat(resultOutput.getPriceCalculateOutput(), is( priceCalculateOutput)); assertThat(resultOutput.getTourInfo(), is(tourInfo)); }