@Test(expected = IllegalArgumentException.class) public void saveOrUpdateWithApplicationDTOsPositionIDNullShouldThrowIllegalArgumentException() { final ApplicationDTO applicationDTO = ApplicationDTO.builder().id(APPLICATION_ID).creationDate(new Date()) .candidateId(CANDIDATE_ID).positionId(null).channelId(CHANNEL_ID).build(); applicationsService.saveOrUpdate(applicationDTO); }
@Transactional @Override public Long saveOrUpdate(ApplicationDTO applicationDTO) { Assert.notNull(applicationDTO); Assert.notNull(applicationDTO.getCandidateId()); Assert.notNull(applicationDTO.getPositionId()); Assert.notNull(applicationDTO.getChannelId()); ApplicationEntity applicationEntity = converterService.convert(applicationDTO, ApplicationEntity.class); ApplicationEntity savedOrUpdateApplicationEntity = applicationsRepository.saveAndFlush(applicationEntity); return savedOrUpdateApplicationEntity.getId(); }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional @Override public Long saveOrUpdate(ApplicationDTO applicationDTO) { Assert.notNull(applicationDTO); Assert.notNull(applicationDTO.getCandidateId()); Assert.notNull(applicationDTO.getPositionId()); Assert.notNull(applicationDTO.getChannelId()); ApplicationEntity applicationEntity = converterService.convert(applicationDTO, ApplicationEntity.class); ApplicationEntity savedOrUpdateApplicationEntity = applicationsRepository.saveAndFlush(applicationEntity); return savedOrUpdateApplicationEntity.getId(); } }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional @Override public Long saveOrUpdate(ApplicationDTO applicationDTO) { Assert.notNull(applicationDTO); Assert.notNull(applicationDTO.getCandidateId()); Assert.notNull(applicationDTO.getPositionId()); Assert.notNull(applicationDTO.getChannelId()); ApplicationEntity applicationEntity = converterService.convert(applicationDTO, ApplicationEntity.class); ApplicationEntity savedOrUpdateApplicationEntity = applicationsRepository.saveAndFlush(applicationEntity); return savedOrUpdateApplicationEntity.getId(); } @Autowired  ApplicationsServiceImpl(
      ApplicationsRepository applicationRepository,
      StatesHistoryService statesHistoryService,
      CandidateRepository candidateRepository,
      ConverterService converterService); }
ApplicationsServiceImpl extends AbstractLogicallyDeletableService<ApplicationDTO, ApplicationEntity> implements ApplicationsService { @Transactional @Override public Long saveOrUpdate(ApplicationDTO applicationDTO) { Assert.notNull(applicationDTO); Assert.notNull(applicationDTO.getCandidateId()); Assert.notNull(applicationDTO.getPositionId()); Assert.notNull(applicationDTO.getChannelId()); ApplicationEntity applicationEntity = converterService.convert(applicationDTO, ApplicationEntity.class); ApplicationEntity savedOrUpdateApplicationEntity = applicationsRepository.saveAndFlush(applicationEntity); return savedOrUpdateApplicationEntity.getId(); } @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 @Override public Long saveOrUpdate(ApplicationDTO applicationDTO) { Assert.notNull(applicationDTO); Assert.notNull(applicationDTO.getCandidateId()); Assert.notNull(applicationDTO.getPositionId()); Assert.notNull(applicationDTO.getChannelId()); ApplicationEntity applicationEntity = converterService.convert(applicationDTO, ApplicationEntity.class); ApplicationEntity savedOrUpdateApplicationEntity = applicationsRepository.saveAndFlush(applicationEntity); return savedOrUpdateApplicationEntity.getId(); } @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);  }