@Test public void testRunChecksSynthaxErrors() { when(rowChecksBuilder.runEmptyValueChecks(ROW_ERROR)).thenReturn(Collections.EMPTY_LIST); when(rowChecksBuilder.runSynthaxChecks(ROW_ERROR)).thenReturn(Arrays.asList(VALIDATION_ERROR3,VALIDATION_ERROR4)); assertThat(rowCheckingService.runChecks(ROW_ERROR,"")).isNotEmpty().hasSize(2); verify(rowChecksBuilder, times(1)).runSynthaxChecks(ROW_ERROR); verify(rowChecksBuilder, times(1)).runEmptyValueChecks(ROW_ERROR); }
public Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease) { Collection<ValidationError> errors = new ArrayList<>(); Collection<ValidationError> emptyValuesErrors = rowChecksBuilder.runEmptyValueChecks(row); if (!emptyValuesErrors.isEmpty()) { errors.addAll(emptyValuesErrors); } else { Collection<ValidationError> synthaxErrors = rowChecksBuilder.runSynthaxChecks(row); if (!synthaxErrors.isEmpty()) { errors.addAll(synthaxErrors); } } if (!row.getListErrorCellType().isEmpty()){ errors.addAll(row.getListErrorCellType()); } return errors; }
RowCheckingService { public Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease) { Collection<ValidationError> errors = new ArrayList<>(); Collection<ValidationError> emptyValuesErrors = rowChecksBuilder.runEmptyValueChecks(row); if (!emptyValuesErrors.isEmpty()) { errors.addAll(emptyValuesErrors); } else { Collection<ValidationError> synthaxErrors = rowChecksBuilder.runSynthaxChecks(row); if (!synthaxErrors.isEmpty()) { errors.addAll(synthaxErrors); } } if (!row.getListErrorCellType().isEmpty()){ errors.addAll(row.getListErrorCellType()); } return errors; } }
RowCheckingService { public Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease) { Collection<ValidationError> errors = new ArrayList<>(); Collection<ValidationError> emptyValuesErrors = rowChecksBuilder.runEmptyValueChecks(row); if (!emptyValuesErrors.isEmpty()) { errors.addAll(emptyValuesErrors); } else { Collection<ValidationError> synthaxErrors = rowChecksBuilder.runSynthaxChecks(row); if (!synthaxErrors.isEmpty()) { errors.addAll(synthaxErrors); } } if (!row.getListErrorCellType().isEmpty()){ errors.addAll(row.getListErrorCellType()); } return errors; } @Autowired  RowCheckingService(RowChecksBuilder rowChecksBuilder); }
RowCheckingService { public Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease) { Collection<ValidationError> errors = new ArrayList<>(); Collection<ValidationError> emptyValuesErrors = rowChecksBuilder.runEmptyValueChecks(row); if (!emptyValuesErrors.isEmpty()) { errors.addAll(emptyValuesErrors); } else { Collection<ValidationError> synthaxErrors = rowChecksBuilder.runSynthaxChecks(row); if (!synthaxErrors.isEmpty()) { errors.addAll(synthaxErrors); } } if (!row.getListErrorCellType().isEmpty()){ errors.addAll(row.getListErrorCellType()); } return errors; } @Autowired  RowCheckingService(RowChecksBuilder rowChecksBuilder); Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease); }
RowCheckingService { public Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease) { Collection<ValidationError> errors = new ArrayList<>(); Collection<ValidationError> emptyValuesErrors = rowChecksBuilder.runEmptyValueChecks(row); if (!emptyValuesErrors.isEmpty()) { errors.addAll(emptyValuesErrors); } else { Collection<ValidationError> synthaxErrors = rowChecksBuilder.runSynthaxChecks(row); if (!synthaxErrors.isEmpty()) { errors.addAll(synthaxErrors); } } if (!row.getListErrorCellType().isEmpty()){ errors.addAll(row.getListErrorCellType()); } return errors; } @Autowired  RowCheckingService(RowChecksBuilder rowChecksBuilder); Collection<ValidationError> runChecks(AssociationUploadRow row, String eRelease);  }