@Test public final void test_updatee() { Recovery expextedResult = getRecoverys().get(0); when(recoveryRepository.update(any(Recovery.class))).thenReturn(expextedResult); Recovery actualResult = recoveryService.update(getRecoverys().get(0)); assertEquals(expextedResult, actualResult); }
@Transactional public List<Recovery> update(List<Recovery> recoveries, BindingResult errors, RequestInfo requestInfo) { try { recoveries = fetchRelated(recoveries); validate(recoveries, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return recoveryRepository.update(recoveries, requestInfo); }
RecoveryService { @Transactional public List<Recovery> update(List<Recovery> recoveries, BindingResult errors, RequestInfo requestInfo) { try { recoveries = fetchRelated(recoveries); validate(recoveries, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return recoveryRepository.update(recoveries, requestInfo); } }
RecoveryService { @Transactional public List<Recovery> update(List<Recovery> recoveries, BindingResult errors, RequestInfo requestInfo) { try { recoveries = fetchRelated(recoveries); validate(recoveries, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return recoveryRepository.update(recoveries, requestInfo); }  }
RecoveryService { @Transactional public List<Recovery> update(List<Recovery> recoveries, BindingResult errors, RequestInfo requestInfo) { try { recoveries = fetchRelated(recoveries); validate(recoveries, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return recoveryRepository.update(recoveries, requestInfo); }  @Transactional List<Recovery> create(List<Recovery> recoveries, BindingResult errors,
                                 RequestInfo requestInfo); @Transactional List<Recovery> update(List<Recovery> recoveries, BindingResult errors,
                                 RequestInfo requestInfo); List<Recovery> fetchRelated(List<Recovery> recoveries); Pagination<Recovery> search(RecoverySearch recoverySearch, BindingResult errors); @Transactional Recovery save(Recovery recovery); @Transactional Recovery update(Recovery recovery); }
RecoveryService { @Transactional public List<Recovery> update(List<Recovery> recoveries, BindingResult errors, RequestInfo requestInfo) { try { recoveries = fetchRelated(recoveries); validate(recoveries, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return recoveryRepository.update(recoveries, requestInfo); }  @Transactional List<Recovery> create(List<Recovery> recoveries, BindingResult errors,
                                 RequestInfo requestInfo); @Transactional List<Recovery> update(List<Recovery> recoveries, BindingResult errors,
                                 RequestInfo requestInfo); List<Recovery> fetchRelated(List<Recovery> recoveries); Pagination<Recovery> search(RecoverySearch recoverySearch, BindingResult errors); @Transactional Recovery save(Recovery recovery); @Transactional Recovery update(Recovery recovery);  }