@Test public void getCandidateShouldReturnNullWhenCandidateIsLogicallyDeleted() { given(candidateRepository.findOne(ID)).willReturn(deletedDummyCandidateEntity); CandidateDTO candidate = candidateService.getCandidate(ID); assertThat(candidate, nullValue()); }
@Transactional(readOnly = true) @Override public CandidateDTO getCandidate(Long id) { Assert.notNull(id); CandidateEntity candidateEntity = candidateRepository.findOne(id); if (candidateEntity != null && !candidateEntity.isDeleted()) { return converterService.convert(candidateEntity, CandidateDTO.class); } return null; }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidate(Long id) { Assert.notNull(id); CandidateEntity candidateEntity = candidateRepository.findOne(id); if (candidateEntity != null && !candidateEntity.isDeleted()) { return converterService.convert(candidateEntity, CandidateDTO.class); } return null; } }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidate(Long id) { Assert.notNull(id); CandidateEntity candidateEntity = candidateRepository.findOne(id); if (candidateEntity != null && !candidateEntity.isDeleted()) { return converterService.convert(candidateEntity, CandidateDTO.class); } return null; } @Autowired  CandidateServiceImpl(CandidateRepository candidateRepository,
                              ApplicationsRepository applicationsRepository,
                              ApplicationsService applicationsService,
                              ConverterService converterService); }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidate(Long id) { Assert.notNull(id); CandidateEntity candidateEntity = candidateRepository.findOne(id); if (candidateEntity != null && !candidateEntity.isDeleted()) { return converterService.convert(candidateEntity, CandidateDTO.class); } return null; } @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(readOnly = true) @Override public CandidateDTO getCandidate(Long id) { Assert.notNull(id); CandidateEntity candidateEntity = candidateRepository.findOne(id); if (candidateEntity != null && !candidateEntity.isDeleted()) { return converterService.convert(candidateEntity, CandidateDTO.class); } return null; } @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);  }