@Test(expected = IllegalArgumentException.class) public void saveOrUpdateShouldThrowIAEWhenNullPassed() { candidateService.saveOrUpdate(null); }
@Transactional @Override public Long saveOrUpdate(CandidateDTO candidate) { Assert.notNull(candidate); CandidateEntity entity = converterService.convert(candidate, CandidateEntity.class); try { return candidateRepository.saveAndFlush(entity).getId(); } catch (ConstraintViolationException | DataIntegrityViolationException ex) { log.error("Save to repository failed.", ex); String candidateName = candidate.getName(); throw new DuplicateCandidateException(candidateName, ex); } }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional @Override public Long saveOrUpdate(CandidateDTO candidate) { Assert.notNull(candidate); CandidateEntity entity = converterService.convert(candidate, CandidateEntity.class); try { return candidateRepository.saveAndFlush(entity).getId(); } catch (ConstraintViolationException | DataIntegrityViolationException ex) { log.error("Save to repository failed.", ex); String candidateName = candidate.getName(); throw new DuplicateCandidateException(candidateName, ex); } } }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional @Override public Long saveOrUpdate(CandidateDTO candidate) { Assert.notNull(candidate); CandidateEntity entity = converterService.convert(candidate, CandidateEntity.class); try { return candidateRepository.saveAndFlush(entity).getId(); } catch (ConstraintViolationException | DataIntegrityViolationException ex) { log.error("Save to repository failed.", ex); String candidateName = candidate.getName(); throw new DuplicateCandidateException(candidateName, ex); } } @Autowired  CandidateServiceImpl(CandidateRepository candidateRepository,
                              ApplicationsRepository applicationsRepository,
                              ApplicationsService applicationsService,
                              ConverterService converterService); }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional @Override public Long saveOrUpdate(CandidateDTO candidate) { Assert.notNull(candidate); CandidateEntity entity = converterService.convert(candidate, CandidateEntity.class); try { return candidateRepository.saveAndFlush(entity).getId(); } catch (ConstraintViolationException | DataIntegrityViolationException ex) { log.error("Save to repository failed.", ex); String candidateName = candidate.getName(); throw new DuplicateCandidateException(candidateName, ex); } } @Autowired  CandidateServiceImpl(CandidateRepository candidateRepository,
                              ApplicationsRepository applicationsRepository,
                              ApplicationsService applicationsService,
                              ConverterService converterService); @Transactional(readOnly = true) @Override CandidateDTO getCandidate(Long id); @Transactional(readOnly = true) @Override CandidateDTO getCandidateByApplicationID(Long applicationID); @Transactional(readOnly = true) @Override PagingResponse<CandidateDTO> getCandidatesByFilterRequest(
      CandidateFilterRequest candidateFilterRequest); @Transactional @Override void deletePositionsByCandidate(CandidateDTO candidateDTO); @Transactional @Override Long saveOrUpdate(CandidateDTO candidate); @Transactional(readOnly = true) @Override CandidateDTO getCandidateDtoByEmail(String email); @Transactional(readOnly = true) @Override CandidateDTO getCandidateDtoByPhone(String phone); }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional @Override public Long saveOrUpdate(CandidateDTO candidate) { Assert.notNull(candidate); CandidateEntity entity = converterService.convert(candidate, CandidateEntity.class); try { return candidateRepository.saveAndFlush(entity).getId(); } catch (ConstraintViolationException | DataIntegrityViolationException ex) { log.error("Save to repository failed.", ex); String candidateName = candidate.getName(); throw new DuplicateCandidateException(candidateName, ex); } } @Autowired  CandidateServiceImpl(CandidateRepository candidateRepository,
                              ApplicationsRepository applicationsRepository,
                              ApplicationsService applicationsService,
                              ConverterService converterService); @Transactional(readOnly = true) @Override CandidateDTO getCandidate(Long id); @Transactional(readOnly = true) @Override CandidateDTO getCandidateByApplicationID(Long applicationID); @Transactional(readOnly = true) @Override PagingResponse<CandidateDTO> getCandidatesByFilterRequest(
      CandidateFilterRequest candidateFilterRequest); @Transactional @Override void deletePositionsByCandidate(CandidateDTO candidateDTO); @Transactional @Override Long saveOrUpdate(CandidateDTO candidate); @Transactional(readOnly = true) @Override CandidateDTO getCandidateDtoByEmail(String email); @Transactional(readOnly = true) @Override CandidateDTO getCandidateDtoByPhone(String phone);  }