@Test public void checkGene() throws Exception { when(geneCheckingRestService.checkGeneSymbolIsValid("MADEUPGENE","")).thenReturn( "Gene symbol MADEUPGENE is not valid"); when(geneCheckingRestService.checkGeneSymbolIsValid("HBS1L","")).thenReturn(null); assertThat(validationChecks.checkGene("","")).isEqualTo("Gene name is empty"); assertThat(validationChecks.checkGene(null,"")).isEqualTo("Gene name is empty"); assertThat(validationChecks.checkGene("MADEUPGENE","")).isEqualTo("Gene symbol MADEUPGENE is not valid"); assertThat(validationChecks.checkGene("HBS1L","")).isNull(); assertThat(validationChecks.checkGene("intergenic","")).isNull(); }
public String checkGene(String geneName, String eRelease) { String error = null; if (geneName == null) { error = "Gene name is empty"; } else { if (geneName.isEmpty()) { error = "Gene name is empty"; } else { if (!geneName.equalsIgnoreCase("intergenic") && !geneName.equalsIgnoreCase("NR")) { error = geneCheckingRestService.checkGeneSymbolIsValid(geneName, eRelease); } } } return error; }
ValidationChecks { public String checkGene(String geneName, String eRelease) { String error = null; if (geneName == null) { error = "Gene name is empty"; } else { if (geneName.isEmpty()) { error = "Gene name is empty"; } else { if (!geneName.equalsIgnoreCase("intergenic") && !geneName.equalsIgnoreCase("NR")) { error = geneCheckingRestService.checkGeneSymbolIsValid(geneName, eRelease); } } } return error; } }
ValidationChecks { public String checkGene(String geneName, String eRelease) { String error = null; if (geneName == null) { error = "Gene name is empty"; } else { if (geneName.isEmpty()) { error = "Gene name is empty"; } else { if (!geneName.equalsIgnoreCase("intergenic") && !geneName.equalsIgnoreCase("NR")) { error = geneCheckingRestService.checkGeneSymbolIsValid(geneName, eRelease); } } } return error; } @Autowired  ValidationChecks(GeneCheckingRestService geneCheckingRestService,
                            SnpCheckingRestService snpCheckingRestService); }
ValidationChecks { public String checkGene(String geneName, String eRelease) { String error = null; if (geneName == null) { error = "Gene name is empty"; } else { if (geneName.isEmpty()) { error = "Gene name is empty"; } else { if (!geneName.equalsIgnoreCase("intergenic") && !geneName.equalsIgnoreCase("NR")) { error = geneCheckingRestService.checkGeneSymbolIsValid(geneName, 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 checkGene(String geneName, String eRelease) { String error = null; if (geneName == null) { error = "Gene name is empty"; } else { if (geneName.isEmpty()) { error = "Gene name is empty"; } else { if (!geneName.equalsIgnoreCase("intergenic") && !geneName.equalsIgnoreCase("NR")) { error = geneCheckingRestService.checkGeneSymbolIsValid(geneName, 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);  }