### Question:
ProjectJsonInputValidation { public void checkOwnerUserId(Errors errors, ProjectJsonInput input) { ValidationResult userIdValidationResult = userIdValidation.validate(input.getOwner()); if (!userIdValidationResult.isValid()) { errors.rejectValue(ProjectJsonInput.PROPERTY_OWNER, "api.error.userid.invalid", userIdValidationResult.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_useridvaluation_invalid_api_error() { when(userIdValidation.validate(any())).thenReturn(failedResult); toTest.checkOwnerUserId(errors, input); verify(errors).rejectValue(eq(ProjectJsonInput.PROPERTY_OWNER), eq("api.error.userid.invalid"), any()); }
@Test public void when_useridvaluation_valid_no_api_error() { when(userIdValidation.validate(any())).thenReturn(okResult); toTest.checkOwnerUserId(errors, input); verify(errors,never()).rejectValue(eq(ProjectJsonInput.PROPERTY_OWNER), eq("api.error.userid.invalid"), any()); }