@Test public final void testUpdate(){ when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); chartOfAccountDetails.add(getChartOfAccountDetail()); chartOfAccountDetailService.update(chartOfAccountDetails, errors); }
@Transactional public List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors) { chartofaccountdetails = fetchRelated(chartofaccountdetails); validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } return chartofaccountdetails; }
ChartOfAccountDetailService { @Transactional public List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors) { chartofaccountdetails = fetchRelated(chartofaccountdetails); validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } return chartofaccountdetails; } }
ChartOfAccountDetailService { @Transactional public List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors) { chartofaccountdetails = fetchRelated(chartofaccountdetails); validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } return chartofaccountdetails; }  }
ChartOfAccountDetailService { @Transactional public List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors) { chartofaccountdetails = fetchRelated(chartofaccountdetails); validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } return chartofaccountdetails; }  List<ChartOfAccountDetail> fetchRelated(List<ChartOfAccountDetail> chartofaccountdetails); @Transactional List<ChartOfAccountDetail> add(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors); @Transactional List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors); void addToQue(ChartOfAccountDetailRequest request); Pagination<ChartOfAccountDetail> search(ChartOfAccountDetailSearch chartOfAccountDetailSearch, BindingResult errors); @Transactional ChartOfAccountDetail save(ChartOfAccountDetail chartOfAccountDetail); @Transactional ChartOfAccountDetail update(ChartOfAccountDetail chartOfAccountDetail); }
ChartOfAccountDetailService { @Transactional public List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors) { chartofaccountdetails = fetchRelated(chartofaccountdetails); validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } return chartofaccountdetails; }  List<ChartOfAccountDetail> fetchRelated(List<ChartOfAccountDetail> chartofaccountdetails); @Transactional List<ChartOfAccountDetail> add(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors); @Transactional List<ChartOfAccountDetail> update(List<ChartOfAccountDetail> chartofaccountdetails, BindingResult errors); void addToQue(ChartOfAccountDetailRequest request); Pagination<ChartOfAccountDetail> search(ChartOfAccountDetailSearch chartOfAccountDetailSearch, BindingResult errors); @Transactional ChartOfAccountDetail save(ChartOfAccountDetail chartOfAccountDetail); @Transactional ChartOfAccountDetail update(ChartOfAccountDetail chartOfAccountDetail);  }