TourInfoServiceImpl implements TourInfoService { @Override public Page<TourInfo> searchTour(TourInfoSearchCriteria criteria, Pageable pageable) { return tourInfoRepository.findPageBySearchCriteria(criteria, pageable); }  @Override Page<TourInfo> searchTour(TourInfoSearchCriteria criteria,
            Pageable pageable);  }
@Test public void testSearchTourInfo01() { TourInfoSearchCriteria criteria = new TourInfoSearchCriteria(); Pageable pageable = PageRequest.of(0, 10); List<TourInfo> mockedList = new ArrayList<TourInfo>(); TourInfo info = new TourInfo(); Arrival a = new Arrival(); a.setArrCode("1234"); info.setArrival(a); Departure departure = new Departure(); departure.setDepCode("5678"); info.setDeparture(departure); info.setTourCode("12345678"); mockedList.add(info); Page<TourInfo> page = new PageImpl<TourInfo>(mockedList); when(tourInfoRepository.findPageBySearchCriteria(criteria, pageable)) .thenReturn(page); Page<TourInfo> result = tourInfoService.searchTour(criteria, pageable); assertThat(result, is(page)); }