@Test public final void test_search() { List<VoucherSubType> voucherSubTypes = getVoucherSubTypes(); VoucherSubTypeSearch voucherSubTypeSearch = new VoucherSubTypeSearch(); voucherSubTypeSearch.setTenantId("default"); Pagination<VoucherSubType> expextedResult = new Pagination<>(); expextedResult.setPagedData(voucherSubTypes); when(voucherSubTypeRepository.search(voucherSubTypeSearch)).thenReturn(expextedResult); Pagination<VoucherSubType> actualResult = voucherSubTypeService.search(voucherSubTypeSearch); assertEquals(expextedResult, actualResult); }
public Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch) { Assert.notNull(voucherSubTypeSearch.getTenantId(), "tenantId is mandatory for voucher search"); return voucherSubTypeRepository.search(voucherSubTypeSearch); }
VoucherSubTypeService { public Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch) { Assert.notNull(voucherSubTypeSearch.getTenantId(), "tenantId is mandatory for voucher search"); return voucherSubTypeRepository.search(voucherSubTypeSearch); } }
VoucherSubTypeService { public Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch) { Assert.notNull(voucherSubTypeSearch.getTenantId(), "tenantId is mandatory for voucher search"); return voucherSubTypeRepository.search(voucherSubTypeSearch); } @Autowired  VoucherSubTypeService(
            VoucherSubTypeRepository voucherSubTypeRepository,
            SmartValidator validator); }
VoucherSubTypeService { public Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch) { Assert.notNull(voucherSubTypeSearch.getTenantId(), "tenantId is mandatory for voucher search"); return voucherSubTypeRepository.search(voucherSubTypeSearch); } @Autowired  VoucherSubTypeService(
            VoucherSubTypeRepository voucherSubTypeRepository,
            SmartValidator validator); @Transactional List<VoucherSubType> create(List<VoucherSubType> voucherSubTypes,
            BindingResult errors, RequestInfo requestInfo); @Transactional List<VoucherSubType> update(List<VoucherSubType> voucherSubTypes, BindingResult errors, RequestInfo requestInfo); List<VoucherSubType> fetchRelated(
            List<VoucherSubType> voucherSubTypes); @Transactional VoucherSubType save(VoucherSubType voucherSubType); @Transactional VoucherSubType update(VoucherSubType voucherSubType); Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch); }
VoucherSubTypeService { public Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch) { Assert.notNull(voucherSubTypeSearch.getTenantId(), "tenantId is mandatory for voucher search"); return voucherSubTypeRepository.search(voucherSubTypeSearch); } @Autowired  VoucherSubTypeService(
            VoucherSubTypeRepository voucherSubTypeRepository,
            SmartValidator validator); @Transactional List<VoucherSubType> create(List<VoucherSubType> voucherSubTypes,
            BindingResult errors, RequestInfo requestInfo); @Transactional List<VoucherSubType> update(List<VoucherSubType> voucherSubTypes, BindingResult errors, RequestInfo requestInfo); List<VoucherSubType> fetchRelated(
            List<VoucherSubType> voucherSubTypes); @Transactional VoucherSubType save(VoucherSubType voucherSubType); @Transactional VoucherSubType update(VoucherSubType voucherSubType); Pagination<VoucherSubType> search(VoucherSubTypeSearch voucherSubTypeSearch);  }