@Test public final void test_search() { List<Instrument> instruments = getInstruments(); InstrumentSearch instrumentSearch = new InstrumentSearch(); Pagination<Instrument> expextedResult = new Pagination<>(); expextedResult.setPagedData(instruments); when(instrumentRepository.search(instrumentSearch)).thenReturn(expextedResult); Pagination<Instrument> actualResult = instrumentService.search(instrumentSearch); assertEquals(expextedResult, actualResult); }
public Pagination<Instrument> search(InstrumentSearch instrumentSearch) { return instrumentRepository.search(instrumentSearch); }
InstrumentService { public Pagination<Instrument> search(InstrumentSearch instrumentSearch) { return instrumentRepository.search(instrumentSearch); } }
InstrumentService { public Pagination<Instrument> search(InstrumentSearch instrumentSearch) { return instrumentRepository.search(instrumentSearch); } @Autowired  InstrumentService(SmartValidator validator, InstrumentRepository instrumentRepository, BankContractRepository bankContractRepository,
            FinancialStatusContractRepository financialStatusContractRepository,
            BankAccountContractRepository bankAccountContractRepository,
            InstrumentTypeRepository instrumentTypeRepository); }
InstrumentService { public Pagination<Instrument> search(InstrumentSearch instrumentSearch) { return instrumentRepository.search(instrumentSearch); } @Autowired  InstrumentService(SmartValidator validator, InstrumentRepository instrumentRepository, BankContractRepository bankContractRepository,
            FinancialStatusContractRepository financialStatusContractRepository,
            BankAccountContractRepository bankAccountContractRepository,
            InstrumentTypeRepository instrumentTypeRepository); @Transactional List<Instrument> create(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); @Transactional List<Instrument> update(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); @Transactional List<Instrument> delete(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); List<Instrument> fetchRelated(List<Instrument> instruments, RequestInfo requestInfo); Pagination<Instrument> search(InstrumentSearch instrumentSearch); @Transactional Instrument save(Instrument instrument); @Transactional Instrument update(Instrument instrument); @Transactional Instrument delete(Instrument instrument); List<Instrument> deposit(InstrumentRequest instrumentDepositRequest, BindingResult errors,
            RequestInfo requestInfo); List<Instrument> dishonor(InstrumentRequest instrumentDepositRequest, BindingResult errors,
            RequestInfo requestInfo); }
InstrumentService { public Pagination<Instrument> search(InstrumentSearch instrumentSearch) { return instrumentRepository.search(instrumentSearch); } @Autowired  InstrumentService(SmartValidator validator, InstrumentRepository instrumentRepository, BankContractRepository bankContractRepository,
            FinancialStatusContractRepository financialStatusContractRepository,
            BankAccountContractRepository bankAccountContractRepository,
            InstrumentTypeRepository instrumentTypeRepository); @Transactional List<Instrument> create(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); @Transactional List<Instrument> update(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); @Transactional List<Instrument> delete(List<Instrument> instruments, BindingResult errors, RequestInfo requestInfo); List<Instrument> fetchRelated(List<Instrument> instruments, RequestInfo requestInfo); Pagination<Instrument> search(InstrumentSearch instrumentSearch); @Transactional Instrument save(Instrument instrument); @Transactional Instrument update(Instrument instrument); @Transactional Instrument delete(Instrument instrument); List<Instrument> deposit(InstrumentRequest instrumentDepositRequest, BindingResult errors,
            RequestInfo requestInfo); List<Instrument> dishonor(InstrumentRequest instrumentDepositRequest, BindingResult errors,
            RequestInfo requestInfo); static final String ACTION_CREATE; static final String ACTION_UPDATE; static final String ACTION_DELETE; static final String ACTION_VIEW; static final String ACTION_EDIT; static final String ACTION_SEARCH; }