@Test public void testCheckBetaIsPresentAndIsNotNegative() throws Exception { when(validationChecks.checkBetaIsPresentAndIsNotNegative((float) -0.8)).thenReturn( "Value is less than 0"); ValidationError error1 = errorCreationService.checkBetaIsPresentAndIsNotNegative((float) -0.8); assertThat(error1).extracting("field", "error", "warning") .contains("Beta", "Value is less than 0", false); when(validationChecks.checkBetaIsPresentAndIsNotNegative((float) 0.6)).thenReturn(null); ValidationError error2 = errorCreationService.checkBetaIsPresentAndIsNotNegative((float) 0.6); assertThat(error2).extracting("field", "error", "warning").contains(null, null, false); }
public ValidationError checkBetaIsPresentAndIsNotNegative(Float beta) { String errorMessage = validationChecks.checkBetaIsPresentAndIsNotNegative(beta); return ErrorProcessingService.createError(errorMessage, "Beta", false); }
ErrorCreationService { public ValidationError checkBetaIsPresentAndIsNotNegative(Float beta) { String errorMessage = validationChecks.checkBetaIsPresentAndIsNotNegative(beta); return ErrorProcessingService.createError(errorMessage, "Beta", false); } }
ErrorCreationService { public ValidationError checkBetaIsPresentAndIsNotNegative(Float beta) { String errorMessage = validationChecks.checkBetaIsPresentAndIsNotNegative(beta); return ErrorProcessingService.createError(errorMessage, "Beta", false); } @Autowired  ErrorCreationService(ValidationChecks validationChecks); }
ErrorCreationService { public ValidationError checkBetaIsPresentAndIsNotNegative(Float beta) { String errorMessage = validationChecks.checkBetaIsPresentAndIsNotNegative(beta); return ErrorProcessingService.createError(errorMessage, "Beta", false); } @Autowired  ErrorCreationService(ValidationChecks validationChecks); ValidationError checkSnpValueIsPresent(String snp); ValidationError checkStrongestAlleleValueIsPresent(String allele); ValidationError checkSnpType(String type); ValidationError checkOrIsPresent(Float or); ValidationError checkOrRecipIsPresentAndLessThanOne(Float orPerCopyRecip); ValidationError checkOrAndOrRecip(Float or, Float orPerCopyRecip); ValidationError checkBetaValuesIsEmpty(Float beta); ValidationError checkBetaUnitIsEmpty(String unit); ValidationError checkBetaDirectionIsEmpty(String direction); ValidationError checkBetaIsPresentAndIsNotNegative(Float beta); ValidationError checkBetaUnitIsPresent(String unit); ValidationError checkBetaDirectionIsPresent(String direction); ValidationError checkOrEmpty(Float or); ValidationError checkOrRecipEmpty(Float orRecip); ValidationError checkOrPerCopyRecipRangeIsEmpty(String recipRange); ValidationError checkRangeIsEmpty(String range); ValidationError checkStandardErrorIsEmpty(Float standardError); ValidationError checkDescriptionIsEmpty(String description); ValidationError checkMantissaIsLessThan10(Integer mantissa); ValidationError checkExponentIsPresentAndNegative(Integer exponent); ValidationError checkGene(String gene, String eRelease); ValidationError checkRiskAllele(String riskAllele); ValidationError checkSnp(String snp, String eRelease); ValidationError checkAssociationRiskFrequency(String riskFrequency); ValidationError checkAlleleRiskFrequency(String riskFrequency); ValidationError checkRangeIsPresent(String range); ValidationError checkOrPerCopyRecipRangeIsPresent(String orPerCopyRecipRange); ValidationError checkSnpGeneLocation(String snp, String gene, String eRelease); ValidationError checkSnpSynthax(String snp, String delimiter); ValidationError checkRiskAlleleSynthax(String allele, String delimiter); ValidationError checkGeneSynthax(String gene, String delimiter); ValidationError checkSnpStatusIsPresent(Boolean genomeWide, Boolean limitedList); }
ErrorCreationService { public ValidationError checkBetaIsPresentAndIsNotNegative(Float beta) { String errorMessage = validationChecks.checkBetaIsPresentAndIsNotNegative(beta); return ErrorProcessingService.createError(errorMessage, "Beta", false); } @Autowired  ErrorCreationService(ValidationChecks validationChecks); ValidationError checkSnpValueIsPresent(String snp); ValidationError checkStrongestAlleleValueIsPresent(String allele); ValidationError checkSnpType(String type); ValidationError checkOrIsPresent(Float or); ValidationError checkOrRecipIsPresentAndLessThanOne(Float orPerCopyRecip); ValidationError checkOrAndOrRecip(Float or, Float orPerCopyRecip); ValidationError checkBetaValuesIsEmpty(Float beta); ValidationError checkBetaUnitIsEmpty(String unit); ValidationError checkBetaDirectionIsEmpty(String direction); ValidationError checkBetaIsPresentAndIsNotNegative(Float beta); ValidationError checkBetaUnitIsPresent(String unit); ValidationError checkBetaDirectionIsPresent(String direction); ValidationError checkOrEmpty(Float or); ValidationError checkOrRecipEmpty(Float orRecip); ValidationError checkOrPerCopyRecipRangeIsEmpty(String recipRange); ValidationError checkRangeIsEmpty(String range); ValidationError checkStandardErrorIsEmpty(Float standardError); ValidationError checkDescriptionIsEmpty(String description); ValidationError checkMantissaIsLessThan10(Integer mantissa); ValidationError checkExponentIsPresentAndNegative(Integer exponent); ValidationError checkGene(String gene, String eRelease); ValidationError checkRiskAllele(String riskAllele); ValidationError checkSnp(String snp, String eRelease); ValidationError checkAssociationRiskFrequency(String riskFrequency); ValidationError checkAlleleRiskFrequency(String riskFrequency); ValidationError checkRangeIsPresent(String range); ValidationError checkOrPerCopyRecipRangeIsPresent(String orPerCopyRecipRange); ValidationError checkSnpGeneLocation(String snp, String gene, String eRelease); ValidationError checkSnpSynthax(String snp, String delimiter); ValidationError checkRiskAlleleSynthax(String allele, String delimiter); ValidationError checkGeneSynthax(String gene, String delimiter); ValidationError checkSnpStatusIsPresent(Boolean genomeWide, Boolean limitedList);  }