@Test public void shouldValidateAgainstNullName() { when(provider.getName()).thenReturn(null); mockValidProviderObjects(); Set<TaskError> errors = TaskDataProviderValidator.validate(provider); assertSingleError(errors, "task.validation.error.blank", "name", "taskDataProvider"); }
public static Set<TaskError> validate(TaskDataProvider provider) { Set<TaskError> errors = new HashSet<>(); validateProviderName(errors, provider.getName()); for (int i = 0; i < provider.getObjects().size(); ++i) { errors.addAll(validateObject(i, provider.getObjects().get(i))); } return errors; }
TaskDataProviderValidator extends GeneralValidator { public static Set<TaskError> validate(TaskDataProvider provider) { Set<TaskError> errors = new HashSet<>(); validateProviderName(errors, provider.getName()); for (int i = 0; i < provider.getObjects().size(); ++i) { errors.addAll(validateObject(i, provider.getObjects().get(i))); } return errors; } }
TaskDataProviderValidator extends GeneralValidator { public static Set<TaskError> validate(TaskDataProvider provider) { Set<TaskError> errors = new HashSet<>(); validateProviderName(errors, provider.getName()); for (int i = 0; i < provider.getObjects().size(); ++i) { errors.addAll(validateObject(i, provider.getObjects().get(i))); } return errors; } private  TaskDataProviderValidator(); }
TaskDataProviderValidator extends GeneralValidator { public static Set<TaskError> validate(TaskDataProvider provider) { Set<TaskError> errors = new HashSet<>(); validateProviderName(errors, provider.getName()); for (int i = 0; i < provider.getObjects().size(); ++i) { errors.addAll(validateObject(i, provider.getObjects().get(i))); } return errors; } private  TaskDataProviderValidator(); static boolean validateIsNotEmpty(TaskDataProvider provider); static Set<TaskError> validate(TaskDataProvider provider); }
TaskDataProviderValidator extends GeneralValidator { public static Set<TaskError> validate(TaskDataProvider provider) { Set<TaskError> errors = new HashSet<>(); validateProviderName(errors, provider.getName()); for (int i = 0; i < provider.getObjects().size(); ++i) { errors.addAll(validateObject(i, provider.getObjects().get(i))); } return errors; } private  TaskDataProviderValidator(); static boolean validateIsNotEmpty(TaskDataProvider provider); static Set<TaskError> validate(TaskDataProvider provider); static final String TASK_DATA_PROVIDER; }