@Test public final void test_save() { Instrument expextedResult = getInstruments().get(0); when(instrumentRepository.save(any(Instrument.class))).thenReturn(expextedResult); Instrument actualResult = instrumentService.save(expextedResult); assertEquals(expextedResult, actualResult); }
@Transactional public Instrument save(Instrument instrument) { return instrumentRepository.save(instrument); }
InstrumentService { @Transactional public Instrument save(Instrument instrument) { return instrumentRepository.save(instrument); } }
InstrumentService { @Transactional public Instrument save(Instrument instrument) { return instrumentRepository.save(instrument); } @Autowired  InstrumentService(SmartValidator validator, InstrumentRepository instrumentRepository, BankContractRepository bankContractRepository,
            FinancialStatusContractRepository financialStatusContractRepository,
            BankAccountContractRepository bankAccountContractRepository,
            InstrumentTypeRepository instrumentTypeRepository); }
InstrumentService { @Transactional public Instrument save(Instrument instrument) { return instrumentRepository.save(instrument); } @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 { @Transactional public Instrument save(Instrument instrument) { return instrumentRepository.save(instrument); } @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; }