@Test public void testSearchTourInfo02() { criteria.setDepDate(new LocalDate(2012, 7, 10).toDate()); criteria.setAdultCount(1); criteria.setArrCode("01"); criteria.setBasePrice(10); criteria.setChildCount(1); criteria.setDepCode("01"); criteria.setTourDays(2); Pageable pageable = PageRequest.of(0, 10); Page<TourInfo> page = tourInfoRepository.findPageBySearchCriteria( criteria, pageable); assertThat(page.getTotalPages(), is(0)); assertThat(page.getNumber(), is(0)); }
@Override @Transactional public Page<TourInfo> findPageBySearchCriteria( TourInfoSearchCriteria criteria, Pageable pageable) { List<TourInfo> content = findTourInfo(criteria, pageable); long total = countSearchTourInfo(criteria); Page<TourInfo> page = new PageImpl<TourInfo>(content, pageable, total); return page; }
TourInfoRepositoryImpl implements TourInfoRepositoryCustom { @Override @Transactional public Page<TourInfo> findPageBySearchCriteria( TourInfoSearchCriteria criteria, Pageable pageable) { List<TourInfo> content = findTourInfo(criteria, pageable); long total = countSearchTourInfo(criteria); Page<TourInfo> page = new PageImpl<TourInfo>(content, pageable, total); return page; } }
TourInfoRepositoryImpl implements TourInfoRepositoryCustom { @Override @Transactional public Page<TourInfo> findPageBySearchCriteria( TourInfoSearchCriteria criteria, Pageable pageable) { List<TourInfo> content = findTourInfo(criteria, pageable); long total = countSearchTourInfo(criteria); Page<TourInfo> page = new PageImpl<TourInfo>(content, pageable, total); return page; }  }
TourInfoRepositoryImpl implements TourInfoRepositoryCustom { @Override @Transactional public Page<TourInfo> findPageBySearchCriteria( TourInfoSearchCriteria criteria, Pageable pageable) { List<TourInfo> content = findTourInfo(criteria, pageable); long total = countSearchTourInfo(criteria); Page<TourInfo> page = new PageImpl<TourInfo>(content, pageable, total); return page; }  @Override @Transactional Page<TourInfo> findPageBySearchCriteria(
            TourInfoSearchCriteria criteria, Pageable pageable); }
TourInfoRepositoryImpl implements TourInfoRepositoryCustom { @Override @Transactional public Page<TourInfo> findPageBySearchCriteria( TourInfoSearchCriteria criteria, Pageable pageable) { List<TourInfo> content = findTourInfo(criteria, pageable); long total = countSearchTourInfo(criteria); Page<TourInfo> page = new PageImpl<TourInfo>(content, pageable, total); return page; }  @Override @Transactional Page<TourInfo> findPageBySearchCriteria(
            TourInfoSearchCriteria criteria, Pageable pageable);  }