@Test public void when_projectidvaluation_valid_no_api_error() { when(projectIdValidation.validate(any())).thenReturn(okResult); toTest.checkProjectId(errors, input); verify(errors,never()).rejectValue(eq(ProjectJsonInput.PROPERTY_NAME), eq("api.error.projectid.invalid"), any()); }
public void checkProjectId(Errors errors, ProjectJsonInput input) { ValidationResult projectIdValidationResult = projectIdValidation.validate(input.getName()); if (!projectIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_NAME, "api.error.projectid.invalid", projectIdValidationResult.getErrorDescription()); } }
ProjectJsonInputValidation { public void checkProjectId(Errors errors, ProjectJsonInput input) { ValidationResult projectIdValidationResult = projectIdValidation.validate(input.getName()); if (!projectIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_NAME, "api.error.projectid.invalid", projectIdValidationResult.getErrorDescription()); } } }
ProjectJsonInputValidation { public void checkProjectId(Errors errors, ProjectJsonInput input) { ValidationResult projectIdValidationResult = projectIdValidation.validate(input.getName()); if (!projectIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_NAME, "api.error.projectid.invalid", projectIdValidationResult.getErrorDescription()); } }  }
ProjectJsonInputValidation { public void checkProjectId(Errors errors, ProjectJsonInput input) { ValidationResult projectIdValidationResult = projectIdValidation.validate(input.getName()); if (!projectIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_NAME, "api.error.projectid.invalid", projectIdValidationResult.getErrorDescription()); } }  boolean supports(Class<?> clazz); ProjectJsonInput asInput(Object target); void checkProjectId(Errors errors, ProjectJsonInput input); void checkApiVersion(Errors errors, ProjectJsonInput input); void checkOwnerUserId(Errors errors, ProjectJsonInput input); }
ProjectJsonInputValidation { public void checkProjectId(Errors errors, ProjectJsonInput input) { ValidationResult projectIdValidationResult = projectIdValidation.validate(input.getName()); if (!projectIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_NAME, "api.error.projectid.invalid", projectIdValidationResult.getErrorDescription()); } }  boolean supports(Class<?> clazz); ProjectJsonInput asInput(Object target); void checkProjectId(Errors errors, ProjectJsonInput input); void checkApiVersion(Errors errors, ProjectJsonInput input); void checkOwnerUserId(Errors errors, ProjectJsonInput input);  }