@Test public final void testCreateInvalid() { BankBranch bankBranch = BankBranch.builder().id("a").code("code").name("name").active(true).build(); when(bankBranchRepository.uniqueCheck(any(String.class), any(BankBranch.class))).thenReturn(true); bankBranches.add(bankBranch); bankBranchService.create(bankBranches, errors, requestInfo); }
@Transactional public List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo) { try { bankBranches = fetchRelated(bankBranches); validate(bankBranches, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (BankBranch b : bankBranches) { b.setId(bankBranchRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return bankBranchRepository.save(bankBranches, requestInfo); }
BankBranchService { @Transactional public List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo) { try { bankBranches = fetchRelated(bankBranches); validate(bankBranches, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (BankBranch b : bankBranches) { b.setId(bankBranchRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return bankBranchRepository.save(bankBranches, requestInfo); } }
BankBranchService { @Transactional public List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo) { try { bankBranches = fetchRelated(bankBranches); validate(bankBranches, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (BankBranch b : bankBranches) { b.setId(bankBranchRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return bankBranchRepository.save(bankBranches, requestInfo); }  }
BankBranchService { @Transactional public List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo) { try { bankBranches = fetchRelated(bankBranches); validate(bankBranches, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (BankBranch b : bankBranches) { b.setId(bankBranchRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return bankBranchRepository.save(bankBranches, requestInfo); }  @Transactional List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo); @Transactional List<BankBranch> update(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo); List<BankBranch> fetchRelated(List<BankBranch> bankbranches); @Transactional List<BankBranch> update(List<BankBranch> bankbranches, BindingResult errors); Pagination<BankBranch> search(BankBranchSearch bankBranchSearch, BindingResult errors); @Transactional BankBranch save(BankBranch bankBranch); @Transactional BankBranch update(BankBranch bankBranch); }
BankBranchService { @Transactional public List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo) { try { bankBranches = fetchRelated(bankBranches); validate(bankBranches, Constants.ACTION_CREATE, errors); if (errors.hasErrors()) { throw new CustomBindException(errors); } for (BankBranch b : bankBranches) { b.setId(bankBranchRepository.getNextSequence()); } } catch (CustomBindException e) { throw new CustomBindException(errors); } return bankBranchRepository.save(bankBranches, requestInfo); }  @Transactional List<BankBranch> create(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo); @Transactional List<BankBranch> update(List<BankBranch> bankBranches, BindingResult errors, RequestInfo requestInfo); List<BankBranch> fetchRelated(List<BankBranch> bankbranches); @Transactional List<BankBranch> update(List<BankBranch> bankbranches, BindingResult errors); Pagination<BankBranch> search(BankBranchSearch bankBranchSearch, BindingResult errors); @Transactional BankBranch save(BankBranch bankBranch); @Transactional BankBranch update(BankBranch bankBranch);  }