@Test public final void testCreate() { when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); when(accountDetailKeyRepository.uniqueCheck(any(String.class), any(AccountDetailKey.class))).thenReturn(true); accountDetailKeyService.create(getAccountDetailKeys(), errors, requestInfo); }
@Transactional public List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors, RequestInfo requestInfo) { try { accountDetailKies = fetchRelated(accountDetailKies); validate(accountDetailKies, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (AccountDetailKey b : accountDetailKies) { b.setId(accountDetailKeyRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return accountDetailKeyRepository.save(accountDetailKies, requestInfo); }
AccountDetailKeyService { @Transactional public List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors, RequestInfo requestInfo) { try { accountDetailKies = fetchRelated(accountDetailKies); validate(accountDetailKies, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (AccountDetailKey b : accountDetailKies) { b.setId(accountDetailKeyRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return accountDetailKeyRepository.save(accountDetailKies, requestInfo); } }
AccountDetailKeyService { @Transactional public List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors, RequestInfo requestInfo) { try { accountDetailKies = fetchRelated(accountDetailKies); validate(accountDetailKies, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (AccountDetailKey b : accountDetailKies) { b.setId(accountDetailKeyRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return accountDetailKeyRepository.save(accountDetailKies, requestInfo); }  }
AccountDetailKeyService { @Transactional public List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors, RequestInfo requestInfo) { try { accountDetailKies = fetchRelated(accountDetailKies); validate(accountDetailKies, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (AccountDetailKey b : accountDetailKies) { b.setId(accountDetailKeyRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return accountDetailKeyRepository.save(accountDetailKies, requestInfo); }  @Transactional List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors,
			RequestInfo requestInfo); @Transactional List<AccountDetailKey> update(List<AccountDetailKey> accountDetailKies, BindingResult errors,
			RequestInfo requestInfo); List<AccountDetailKey> fetchRelated(List<AccountDetailKey> accountdetailkeys); @Transactional List<AccountDetailKey> add(List<AccountDetailKey> accountdetailkeys, BindingResult errors); @Transactional List<AccountDetailKey> update(List<AccountDetailKey> accountdetailkeys, BindingResult errors); void addToQue(AccountDetailKeyRequest request); Pagination<AccountDetailKey> search(AccountDetailKeySearch accountDetailKeySearch, BindingResult errors); @Transactional AccountDetailKey save(AccountDetailKey accountDetailKey); @Transactional AccountDetailKey update(AccountDetailKey accountDetailKey); }
AccountDetailKeyService { @Transactional public List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors, RequestInfo requestInfo) { try { accountDetailKies = fetchRelated(accountDetailKies); validate(accountDetailKies, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (AccountDetailKey b : accountDetailKies) { b.setId(accountDetailKeyRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return accountDetailKeyRepository.save(accountDetailKies, requestInfo); }  @Transactional List<AccountDetailKey> create(List<AccountDetailKey> accountDetailKies, BindingResult errors,
			RequestInfo requestInfo); @Transactional List<AccountDetailKey> update(List<AccountDetailKey> accountDetailKies, BindingResult errors,
			RequestInfo requestInfo); List<AccountDetailKey> fetchRelated(List<AccountDetailKey> accountdetailkeys); @Transactional List<AccountDetailKey> add(List<AccountDetailKey> accountdetailkeys, BindingResult errors); @Transactional List<AccountDetailKey> update(List<AccountDetailKey> accountdetailkeys, BindingResult errors); void addToQue(AccountDetailKeyRequest request); Pagination<AccountDetailKey> search(AccountDetailKeySearch accountDetailKeySearch, BindingResult errors); @Transactional AccountDetailKey save(AccountDetailKey accountDetailKey); @Transactional AccountDetailKey update(AccountDetailKey accountDetailKey);  }