@Test public final void test_update() { Fund expextedResult = getFunds().get(0); when(fundRepository.update(any(Fund.class))).thenReturn(expextedResult); Fund actualResult = fundService.update(getFunds().get(0)); assertEquals(expextedResult, actualResult); }
@Transactional public List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo) { try { funds = fetchRelated(funds); validate(funds, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (Fund b : funds) { b.update(); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return fundRepository.update(funds, requestInfo); }
FundService { @Transactional public List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo) { try { funds = fetchRelated(funds); validate(funds, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (Fund b : funds) { b.update(); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return fundRepository.update(funds, requestInfo); } }
FundService { @Transactional public List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo) { try { funds = fetchRelated(funds); validate(funds, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (Fund b : funds) { b.update(); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return fundRepository.update(funds, requestInfo); }  }
FundService { @Transactional public List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo) { try { funds = fetchRelated(funds); validate(funds, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (Fund b : funds) { b.update(); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return fundRepository.update(funds, requestInfo); }  @Transactional List<Fund> create(List<Fund> funds, BindingResult errors, RequestInfo requestInfo); @Transactional List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo); List<Fund> fetchRelated(List<Fund> funds); Pagination<Fund> search(FundSearch fundSearch, BindingResult errors); @Transactional Fund save(Fund fund); @Transactional Fund update(Fund fund); }
FundService { @Transactional public List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo) { try { funds = fetchRelated(funds); validate(funds, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (Fund b : funds) { b.update(); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return fundRepository.update(funds, requestInfo); }  @Transactional List<Fund> create(List<Fund> funds, BindingResult errors, RequestInfo requestInfo); @Transactional List<Fund> update(List<Fund> funds, BindingResult errors, RequestInfo requestInfo); List<Fund> fetchRelated(List<Fund> funds); Pagination<Fund> search(FundSearch fundSearch, BindingResult errors); @Transactional Fund save(Fund fund); @Transactional Fund update(Fund fund);  }