### Question:
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);  }### Answer:
@Test public void when_projectidvaluation_invalid_api_error() { when(projectIdValidation.validate(any())).thenReturn(failedResult); toTest.checkProjectId(errors, input); verify(errors).rejectValue(eq(ProjectJsonInput.PROPERTY_NAME), eq("api.error.projectid.invalid"), any()); }
@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()); }