@Test(expected = IllegalArgumentException.class) public void isValidNonExistingCandidateShouldThrowIllegalArgumentExceptionWhenCandidateIsNull() { this.candidateValidatorHelper.isValidNonExistingCandidate(null); }
public boolean isValidNonExistingCandidate(CandidateDTO candidateDTO) { this.preValidateNonExistingCandidate(candidateDTO); CandidateDTO candidateDTOByEmail = this.candidateService.getCandidateDtoByEmail(candidateDTO.getEmail()); CandidateDTO candidateDTOByPhone = this.candidateService.getCandidateDtoByPhone(candidateDTO.getPhone()); if (candidateDTOByEmail == null && candidateDTOByPhone == null) { return true; } return false; }
CandidateValidatorHelper { public boolean isValidNonExistingCandidate(CandidateDTO candidateDTO) { this.preValidateNonExistingCandidate(candidateDTO); CandidateDTO candidateDTOByEmail = this.candidateService.getCandidateDtoByEmail(candidateDTO.getEmail()); CandidateDTO candidateDTOByPhone = this.candidateService.getCandidateDtoByPhone(candidateDTO.getPhone()); if (candidateDTOByEmail == null && candidateDTOByPhone == null) { return true; } return false; } }
CandidateValidatorHelper { public boolean isValidNonExistingCandidate(CandidateDTO candidateDTO) { this.preValidateNonExistingCandidate(candidateDTO); CandidateDTO candidateDTOByEmail = this.candidateService.getCandidateDtoByEmail(candidateDTO.getEmail()); CandidateDTO candidateDTOByPhone = this.candidateService.getCandidateDtoByPhone(candidateDTO.getPhone()); if (candidateDTOByEmail == null && candidateDTOByPhone == null) { return true; } return false; }  }
CandidateValidatorHelper { public boolean isValidNonExistingCandidate(CandidateDTO candidateDTO) { this.preValidateNonExistingCandidate(candidateDTO); CandidateDTO candidateDTOByEmail = this.candidateService.getCandidateDtoByEmail(candidateDTO.getEmail()); CandidateDTO candidateDTOByPhone = this.candidateService.getCandidateDtoByPhone(candidateDTO.getPhone()); if (candidateDTOByEmail == null && candidateDTOByPhone == null) { return true; } return false; }  boolean isValidNonExistingCandidate(CandidateDTO candidateDTO); boolean isValidExistingCandidate(CandidateDTO candidateDTO); }
CandidateValidatorHelper { public boolean isValidNonExistingCandidate(CandidateDTO candidateDTO) { this.preValidateNonExistingCandidate(candidateDTO); CandidateDTO candidateDTOByEmail = this.candidateService.getCandidateDtoByEmail(candidateDTO.getEmail()); CandidateDTO candidateDTOByPhone = this.candidateService.getCandidateDtoByPhone(candidateDTO.getPhone()); if (candidateDTOByEmail == null && candidateDTOByPhone == null) { return true; } return false; }  boolean isValidNonExistingCandidate(CandidateDTO candidateDTO); boolean isValidExistingCandidate(CandidateDTO candidateDTO);  }