@Test public void checkSnp() throws Exception { when(snpCheckingRestService.checkSnpIdentifierIsValid("MADEUPSNP","")).thenReturn( "SNP identifier MADEUPSNP is not valid"); when(snpCheckingRestService.checkSnpIdentifierIsValid("rs7329174","")).thenReturn(null); assertThat(validationChecks.checkSnp("","")).isEqualTo("SNP identifier is empty"); assertThat(validationChecks.checkSnp(null,"")).isEqualTo("SNP identifier is empty"); assertThat(validationChecks.checkSnp("MADEUPSNP","")).isEqualTo("SNP identifier MADEUPSNP is not valid"); assertThat(validationChecks.checkSnp("rs7329174","")).isNull(); }
public String checkSnp(String snp, String eRelease) { String error = null; if (snp == null) { error = "SNP identifier is empty"; } else { if (snp.isEmpty()) { error = "SNP identifier is empty"; } else { error = snpCheckingRestService.checkSnpIdentifierIsValid(snp, eRelease); } } return error; }
ValidationChecks { public String checkSnp(String snp, String eRelease) { String error = null; if (snp == null) { error = "SNP identifier is empty"; } else { if (snp.isEmpty()) { error = "SNP identifier is empty"; } else { error = snpCheckingRestService.checkSnpIdentifierIsValid(snp, eRelease); } } return error; } }
ValidationChecks { public String checkSnp(String snp, String eRelease) { String error = null; if (snp == null) { error = "SNP identifier is empty"; } else { if (snp.isEmpty()) { error = "SNP identifier is empty"; } else { error = snpCheckingRestService.checkSnpIdentifierIsValid(snp, eRelease); } } return error; } @Autowired  ValidationChecks(GeneCheckingRestService geneCheckingRestService,
                            SnpCheckingRestService snpCheckingRestService); }
ValidationChecks { public String checkSnp(String snp, String eRelease) { String error = null; if (snp == null) { error = "SNP identifier is empty"; } else { if (snp.isEmpty()) { error = "SNP identifier is empty"; } else { error = snpCheckingRestService.checkSnpIdentifierIsValid(snp, eRelease); } } return error; } @Autowired  ValidationChecks(GeneCheckingRestService geneCheckingRestService,
                            SnpCheckingRestService snpCheckingRestService); String checkValueIsPresent(String value); String checkValueIsEmpty(String value); String checkValueIsEmpty(Float value); String checkSnpType(String value); String checkOrIsPresent(Float value); String checkOrRecipIsPresentAndLessThanOne(Float value); String checkOrAndOrRecip(Float or, Float orRecip); String checkBetaIsPresentAndIsNotNegative(Float value); String checkBetaDirectionIsPresent(String value); String checkMantissaIsLessThan10(Integer value); String checkExponentIsPresentAndNegative(Integer value); String checkGene(String geneName, String eRelease); String checkSnp(String snp, String eRelease); String checkSnpGeneLocation(String snp, String gene, String eRelease); String checkRiskAllele(String riskAlleleName); String checkRiskFrequency(String riskFrequency); String checkSynthax(String value, String delimiter); String checkSnpStatus(Boolean genomeWide, Boolean limitedList); }
ValidationChecks { public String checkSnp(String snp, String eRelease) { String error = null; if (snp == null) { error = "SNP identifier is empty"; } else { if (snp.isEmpty()) { error = "SNP identifier is empty"; } else { error = snpCheckingRestService.checkSnpIdentifierIsValid(snp, eRelease); } } return error; } @Autowired  ValidationChecks(GeneCheckingRestService geneCheckingRestService,
                            SnpCheckingRestService snpCheckingRestService); String checkValueIsPresent(String value); String checkValueIsEmpty(String value); String checkValueIsEmpty(Float value); String checkSnpType(String value); String checkOrIsPresent(Float value); String checkOrRecipIsPresentAndLessThanOne(Float value); String checkOrAndOrRecip(Float or, Float orRecip); String checkBetaIsPresentAndIsNotNegative(Float value); String checkBetaDirectionIsPresent(String value); String checkMantissaIsLessThan10(Integer value); String checkExponentIsPresentAndNegative(Integer value); String checkGene(String geneName, String eRelease); String checkSnp(String snp, String eRelease); String checkSnpGeneLocation(String snp, String gene, String eRelease); String checkRiskAllele(String riskAlleleName); String checkRiskFrequency(String riskFrequency); String checkSynthax(String value, String delimiter); String checkSnpStatus(Boolean genomeWide, Boolean limitedList);  }