@Test public final void test_update_with_out_kafka() { final List<BudgetDetail> expextedResult = getBudgetDetails(); when(budgetDetailRepository.uniqueCheck(any(String.class), any(BudgetDetail.class))).thenReturn(true); when(budgetDetailRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); final List<BudgetDetail> actualResult = budgetDetailService.update(expextedResult, errors, requestInfo); assertEquals(expextedResult, actualResult); }
@Transactional public List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors, final RequestInfo requestInfo) { try { budgetDetails = fetchRelated(budgetDetails,requestInfo); validate(budgetDetails, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (final CustomBindException e) { throw new CustomBindException(errors); } return budgetDetailRepository.update(budgetDetails, requestInfo); }
BudgetDetailService { @Transactional public List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors, final RequestInfo requestInfo) { try { budgetDetails = fetchRelated(budgetDetails,requestInfo); validate(budgetDetails, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (final CustomBindException e) { throw new CustomBindException(errors); } return budgetDetailRepository.update(budgetDetails, requestInfo); } }
BudgetDetailService { @Transactional public List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors, final RequestInfo requestInfo) { try { budgetDetails = fetchRelated(budgetDetails,requestInfo); validate(budgetDetails, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (final CustomBindException e) { throw new CustomBindException(errors); } return budgetDetailRepository.update(budgetDetails, requestInfo); }  }
BudgetDetailService { @Transactional public List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors, final RequestInfo requestInfo) { try { budgetDetails = fetchRelated(budgetDetails,requestInfo); validate(budgetDetails, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (final CustomBindException e) { throw new CustomBindException(errors); } return budgetDetailRepository.update(budgetDetails, requestInfo); }  @Transactional List<BudgetDetail> create(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); @Transactional List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); @Transactional List<BudgetDetail> delete(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); List<BudgetDetail> fetchRelated(final List<BudgetDetail> budgetdetails,RequestInfo requestInfo); Pagination<BudgetDetail> search(final BudgetDetailSearch budgetDetailSearch); @Transactional BudgetDetail save(final BudgetDetail budgetDetail); @Transactional BudgetDetail update(final BudgetDetail budgetDetail); @Transactional BudgetDetail delete(final BudgetDetail budgetDetail); }
BudgetDetailService { @Transactional public List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors, final RequestInfo requestInfo) { try { budgetDetails = fetchRelated(budgetDetails,requestInfo); validate(budgetDetails, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (final CustomBindException e) { throw new CustomBindException(errors); } return budgetDetailRepository.update(budgetDetails, requestInfo); }  @Transactional List<BudgetDetail> create(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); @Transactional List<BudgetDetail> update(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); @Transactional List<BudgetDetail> delete(List<BudgetDetail> budgetDetails, final BindingResult errors,
            final RequestInfo requestInfo); List<BudgetDetail> fetchRelated(final List<BudgetDetail> budgetdetails,RequestInfo requestInfo); Pagination<BudgetDetail> search(final BudgetDetailSearch budgetDetailSearch); @Transactional BudgetDetail save(final BudgetDetail budgetDetail); @Transactional BudgetDetail update(final BudgetDetail budgetDetail); @Transactional BudgetDetail delete(final BudgetDetail budgetDetail); 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; }