@Test public void testRunEmptyValueChecks() throws Exception { when(errorCreationService.checkSnpValueIsPresent(EMPTY_ROW.getSnp())).thenReturn(ERROR_MISSING_SNP); when(errorCreationService.checkStrongestAlleleValueIsPresent(EMPTY_ROW.getStrongestAllele())).thenReturn(ERROR_MISSING_RA); when(errorCreationService.checkSnpValueIsPresent(ROW_WITH_NO_SNP.getSnp())).thenReturn(ERROR_MISSING_SNP); when(errorCreationService.checkStrongestAlleleValueIsPresent(ROW_WITH_NO_SNP.getStrongestAllele())).thenReturn(ERROR_03); when(errorCreationService.checkSnpValueIsPresent(ROW_WITH_NO_RA.getSnp())).thenReturn(ERROR_03); when(errorCreationService.checkStrongestAlleleValueIsPresent(ROW_WITH_NO_RA.getStrongestAllele())).thenReturn(ERROR_MISSING_RA); assertThat(rowChecksBuilder.runEmptyValueChecks(EMPTY_ROW)).hasSize(2); assertThat(rowChecksBuilder.runEmptyValueChecks(EMPTY_ROW)).extracting("field", "error") .contains(tuple( "SNP", "Missing value"), tuple("Strongest SNP-Risk Allele/Effect Allele", "Missing value")); assertThat(rowChecksBuilder.runEmptyValueChecks(ROW_WITH_NO_SNP)).hasSize(1); assertThat(rowChecksBuilder.runEmptyValueChecks(ROW_WITH_NO_SNP)).extracting("field", "error") .contains(tuple("SNP", "Missing value")); assertThat(rowChecksBuilder.runEmptyValueChecks(ROW_WITH_NO_RA)).hasSize(1); assertThat(rowChecksBuilder.runEmptyValueChecks(ROW_WITH_NO_RA)).extracting("field", "error") .contains(tuple("Strongest SNP-Risk Allele/Effect Allele", "Missing value")); }
public Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); errors.add(errorCreationService.checkSnpValueIsPresent(row.getSnp())); errors.add(errorCreationService.checkStrongestAlleleValueIsPresent(row.getStrongestAllele())); return ErrorProcessingService.checkForValidErrors(errors); }
RowChecksBuilder { public Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); errors.add(errorCreationService.checkSnpValueIsPresent(row.getSnp())); errors.add(errorCreationService.checkStrongestAlleleValueIsPresent(row.getStrongestAllele())); return ErrorProcessingService.checkForValidErrors(errors); } }
RowChecksBuilder { public Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); errors.add(errorCreationService.checkSnpValueIsPresent(row.getSnp())); errors.add(errorCreationService.checkStrongestAlleleValueIsPresent(row.getStrongestAllele())); return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); }
RowChecksBuilder { public Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); errors.add(errorCreationService.checkSnpValueIsPresent(row.getSnp())); errors.add(errorCreationService.checkStrongestAlleleValueIsPresent(row.getStrongestAllele())); return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row); Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row); }
RowChecksBuilder { public Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row) { Collection<ValidationError> errors = new ArrayList<>(); errors.add(errorCreationService.checkSnpValueIsPresent(row.getSnp())); errors.add(errorCreationService.checkStrongestAlleleValueIsPresent(row.getStrongestAllele())); return ErrorProcessingService.checkForValidErrors(errors); } @Autowired  RowChecksBuilder(ErrorCreationService errorCreationService); Collection<ValidationError> runEmptyValueChecks(AssociationUploadRow row); Collection<ValidationError> runSynthaxChecks(AssociationUploadRow row);  }