@Test public final void test_update_with_out_kafka() { List<SurrenderReason> expextedResult = getSurrenderReasons(); when(surrenderReasonRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(true); List<SurrenderReason> actualResult = surrenderReasonService.update(expextedResult, errors, requestInfo); assertEquals(expextedResult, actualResult); }
@Transactional public List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors, RequestInfo requestInfo) { try { surrenderReasons = fetchRelated(surrenderReasons); validate(surrenderReasons, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (CustomBindException e) { throw new CustomBindException(errors); } return surrenderReasonRepository.update(surrenderReasons, requestInfo); }
SurrenderReasonService { @Transactional public List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors, RequestInfo requestInfo) { try { surrenderReasons = fetchRelated(surrenderReasons); validate(surrenderReasons, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (CustomBindException e) { throw new CustomBindException(errors); } return surrenderReasonRepository.update(surrenderReasons, requestInfo); } }
SurrenderReasonService { @Transactional public List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors, RequestInfo requestInfo) { try { surrenderReasons = fetchRelated(surrenderReasons); validate(surrenderReasons, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (CustomBindException e) { throw new CustomBindException(errors); } return surrenderReasonRepository.update(surrenderReasons, requestInfo); } @Autowired  SurrenderReasonService(SmartValidator validator, SurrenderReasonRepository surrenderReasonRepository); }
SurrenderReasonService { @Transactional public List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors, RequestInfo requestInfo) { try { surrenderReasons = fetchRelated(surrenderReasons); validate(surrenderReasons, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (CustomBindException e) { throw new CustomBindException(errors); } return surrenderReasonRepository.update(surrenderReasons, requestInfo); } @Autowired  SurrenderReasonService(SmartValidator validator, SurrenderReasonRepository surrenderReasonRepository); @Transactional List<SurrenderReason> create(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional List<SurrenderReason> delete(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional SurrenderReason delete(SurrenderReason surrenderReason); List<SurrenderReason> fetchRelated(List<SurrenderReason> surrenderreasons); Pagination<SurrenderReason> search(SurrenderReasonSearch surrenderReasonSearch); @Transactional SurrenderReason save(SurrenderReason surrenderReason); @Transactional SurrenderReason update(SurrenderReason surrenderReason); }
SurrenderReasonService { @Transactional public List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors, RequestInfo requestInfo) { try { surrenderReasons = fetchRelated(surrenderReasons); validate(surrenderReasons, ACTION_UPDATE, errors); if (errors.hasErrors()) throw new CustomBindException(errors); } catch (CustomBindException e) { throw new CustomBindException(errors); } return surrenderReasonRepository.update(surrenderReasons, requestInfo); } @Autowired  SurrenderReasonService(SmartValidator validator, SurrenderReasonRepository surrenderReasonRepository); @Transactional List<SurrenderReason> create(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional List<SurrenderReason> update(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional List<SurrenderReason> delete(List<SurrenderReason> surrenderReasons, BindingResult errors,
            RequestInfo requestInfo); @Transactional SurrenderReason delete(SurrenderReason surrenderReason); List<SurrenderReason> fetchRelated(List<SurrenderReason> surrenderreasons); Pagination<SurrenderReason> search(SurrenderReasonSearch surrenderReasonSearch); @Transactional SurrenderReason save(SurrenderReason surrenderReason); @Transactional SurrenderReason update(SurrenderReason surrenderReason); 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; }