@Test public void testRunSynthaxChecks() throws Exception { when(errorCreationService.checkSnpSynthax(INTERACTION_ROW_NO_ERROR.getSnp(), "x")).thenReturn(ERROR_03); when(errorCreationService.checkRiskAlleleSynthax(INTERACTION_ROW_NO_ERROR.getStrongestAllele(), "x")).thenReturn(ERROR_03); when(errorCreationService.checkSnpSynthax(INTERACTION_ROW_ERROR.getSnp(), "x")).thenReturn(SNP_INTERACTION_ERROR_01); when(errorCreationService.checkRiskAlleleSynthax(INTERACTION_ROW_ERROR.getStrongestAllele(), "x")).thenReturn( SNP_INTERACTION_ERROR_02); when(errorCreationService.checkGeneSynthax(INTERACTION_ROW_ERROR.getAuthorReportedGene(), "x")).thenReturn( SNP_INTERACTION_ERROR_03); assertThat(rowChecksBuilder.runSynthaxChecks(INTERACTION_ROW_NO_ERROR)).hasSize(0); assertThat(rowChecksBuilder.runSynthaxChecks(INTERACTION_ROW_ERROR)).hasSize(3); assertThat(rowChecksBuilder.runSynthaxChecks(INTERACTION_ROW_ERROR)).extracting("field", "error") .contains(tuple("SNP", "Value does not contain correct separator"), tuple("Risk Allele", "Value does not contain correct separator"), tuple("Gene", "Value does not contain correct separator")); }
public Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); if (row.getMultiSnpHaplotype().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), ";")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), ";")); } if (row.getSnpInteraction().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), "x")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), "x")); if (row.getAuthorReportedGene() != null && !row.getAuthorReportedGene().isEmpty()) { errors.add(errorCreationService.checkGeneSynthax(row.getAuthorReportedGene(), "x")); } } return ErrorProcessingService.checkForValidErrors(errors); }
RowChecksBuilder { public Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); if (row.getMultiSnpHaplotype().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), ";")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), ";")); } if (row.getSnpInteraction().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), "x")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), "x")); if (row.getAuthorReportedGene() != null && !row.getAuthorReportedGene().isEmpty()) { errors.add(errorCreationService.checkGeneSynthax(row.getAuthorReportedGene(), "x")); } } return ErrorProcessingService.checkForValidErrors(errors); } }
RowChecksBuilder { public Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); if (row.getMultiSnpHaplotype().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), ";")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), ";")); } if (row.getSnpInteraction().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), "x")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), "x")); if (row.getAuthorReportedGene() != null && !row.getAuthorReportedGene().isEmpty()) { errors.add(errorCreationService.checkGeneSynthax(row.getAuthorReportedGene(), "x")); } } return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); }
RowChecksBuilder { public Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); if (row.getMultiSnpHaplotype().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), ";")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), ";")); } if (row.getSnpInteraction().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), "x")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), "x")); if (row.getAuthorReportedGene() != null && !row.getAuthorReportedGene().isEmpty()) { errors.add(errorCreationService.checkGeneSynthax(row.getAuthorReportedGene(), "x")); } } return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row); Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row); }
RowChecksBuilder { public Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); if (row.getMultiSnpHaplotype().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), ";")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), ";")); } if (row.getSnpInteraction().equalsIgnoreCase("Y")) { errors.add(errorCreationService.checkSnpSynthax(row.getSnp(), "x")); errors.add(errorCreationService.checkRiskAlleleSynthax(row.getStrongestAllele(), "x")); if (row.getAuthorReportedGene() != null && !row.getAuthorReportedGene().isEmpty()) { errors.add(errorCreationService.checkGeneSynthax(row.getAuthorReportedGene(), "x")); } } return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row); Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row);  }