@Test public void getApplicationDtoByIdShouldReturnExistingApplicationDtoWhenApplicationEntityExists() { given(applicationsRepository.findOne(APPLICATION_ID)).willReturn(applicationEntity); given(converterService.convert(applicationEntity, ApplicationDTO.class)) .willReturn(applicationDTO); ApplicationDTO returnedApplicationDto = applicationsService.getApplicationDtoById(APPLICATION_ID); assertThat(returnedApplicationDto, notNullValue()); assertThat(returnedApplicationDto, equalTo(applicationDTO)); then(applicationsRepository).should().findOne(APPLICATION_ID); then(converterService).should().convert(applicationEntity, ApplicationDTO.class); }
@Transactional(readOnly = true) @Override public ApplicationDTO getApplicationDtoById(Long applicationId) { Assert.notNull(applicationId); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationId); if (applicationEntity != null) { return converterService.convert(applicationEntity, ApplicationDTO.class); } return null; }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional(readOnly = true) @Override public ApplicationDTO getApplicationDtoById(Long applicationId) { Assert.notNull(applicationId); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationId); if (applicationEntity != null) { return converterService.convert(applicationEntity, ApplicationDTO.class); } return null; } }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional(readOnly = true) @Override public ApplicationDTO getApplicationDtoById(Long applicationId) { Assert.notNull(applicationId); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationId); if (applicationEntity != null) { return converterService.convert(applicationEntity, ApplicationDTO.class); } return null; } @Autowired  ApplicationsServiceImpl(
      ApplicationsRepository applicationRepository,
      StatesHistoryService statesHistoryService,
      CandidateRepository candidateRepository,
      ConverterService converterService); }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional(readOnly = true) @Override public ApplicationDTO getApplicationDtoById(Long applicationId) { Assert.notNull(applicationId); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationId); if (applicationEntity != null) { return converterService.convert(applicationEntity, ApplicationDTO.class); } return null; } @Autowired  ApplicationsServiceImpl(
      ApplicationsRepository applicationRepository,
      StatesHistoryService statesHistoryService,
      CandidateRepository candidateRepository,
      ConverterService converterService); @Transactional(readOnly = true) @Override List<ApplicationDTO> getApplicationsByCandidateDTO(CandidateDTO candidateDTO); @Transactional(readOnly = true) @Override PagingResponse<CandidateApplicationDTO> getApplicationsByCandidateId(
      Long candidateId,
      int page,
      int size); @Transactional @Override void deleteApplicationsByCandidateDTO(CandidateDTO candidateDTO); @Transactional(readOnly = true) @Override ApplicationDTO getApplicationDtoById(Long applicationId); @Transactional @Override Long saveOrUpdate(ApplicationDTO applicationDTO); @Transactional @Override Long saveApplication(ApplicationDTO applicationDTO, StateHistoryDTO stateHistoryDTO); }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional(readOnly = true) @Override public ApplicationDTO getApplicationDtoById(Long applicationId) { Assert.notNull(applicationId); ApplicationEntity applicationEntity = applicationsRepository.findOne(applicationId); if (applicationEntity != null) { return converterService.convert(applicationEntity, ApplicationDTO.class); } return null; } @Autowired  ApplicationsServiceImpl(
      ApplicationsRepository applicationRepository,
      StatesHistoryService statesHistoryService,
      CandidateRepository candidateRepository,
      ConverterService converterService); @Transactional(readOnly = true) @Override List<ApplicationDTO> getApplicationsByCandidateDTO(CandidateDTO candidateDTO); @Transactional(readOnly = true) @Override PagingResponse<CandidateApplicationDTO> getApplicationsByCandidateId(
      Long candidateId,
      int page,
      int size); @Transactional @Override void deleteApplicationsByCandidateDTO(CandidateDTO candidateDTO); @Transactional(readOnly = true) @Override ApplicationDTO getApplicationDtoById(Long applicationId); @Transactional @Override Long saveOrUpdate(ApplicationDTO applicationDTO); @Transactional @Override Long saveApplication(ApplicationDTO applicationDTO, StateHistoryDTO stateHistoryDTO);  }