@Test public void getCandidateByApplicationIdShouldReturnCandidateDTOWhenThereIsApplicationWithTheGivenId() { given(applicationsRepository.findOne(APPLICATION_ID)) .willReturn(dummyApplicationEntity); given(converterService.convert(dummyCandidateEntity, CandidateDTO.class)) .willReturn(dummyCandidateDto); CandidateDTO candidate = candidateService.getCandidateByApplicationID(APPLICATION_ID); assertThat(candidate, equalTo(dummyCandidateDto)); }
@Transactional(readOnly = true) @Override public CandidateDTO getCandidateByApplicationID(Long applicationID) { Assert.notNull(applicationID); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationID); CandidateDTO candidateDTO = (applicationEntity != null ? converterService .convert(applicationEntity.getCandidateEntity(), CandidateDTO.class) : null); return candidateDTO; }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidateByApplicationID(Long applicationID) { Assert.notNull(applicationID); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationID); CandidateDTO candidateDTO = (applicationEntity != null ? converterService .convert(applicationEntity.getCandidateEntity(), CandidateDTO.class) : null); return candidateDTO; } }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidateByApplicationID(Long applicationID) { Assert.notNull(applicationID); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationID); CandidateDTO candidateDTO = (applicationEntity != null ? converterService .convert(applicationEntity.getCandidateEntity(), CandidateDTO.class) : null); return candidateDTO; } @Autowired  CandidateServiceImpl(CandidateRepository candidateRepository,
                              ApplicationsRepository applicationsRepository,
                              ApplicationsService applicationsService,
                              ConverterService converterService); }
CandidateServiceImpl extends AbstractLogicallyDeletableService<CandidateDTO, CandidateEntity> implements CandidateService { @Transactional(readOnly = true) @Override public CandidateDTO getCandidateByApplicationID(Long applicationID) { Assert.notNull(applicationID); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationID); CandidateDTO candidateDTO = (applicationEntity != null ? converterService .convert(applicationEntity.getCandidateEntity(), CandidateDTO.class) : null); return candidateDTO; } @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 getCandidateByApplicationID(Long applicationID) { Assert.notNull(applicationID); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationID); CandidateDTO candidateDTO = (applicationEntity != null ? converterService .convert(applicationEntity.getCandidateEntity(), CandidateDTO.class) : null); return candidateDTO; } @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);  }