Skills101
← All practice quizzes

Quiz: Validation and Errors

5 questionsNo time limitPass: 60%+10 XP on first pass

Reject bad input with Bean Validation (@NotBlank, @Min, @Size and @Valid), turn exceptions into clean JSON errors with @RestControllerAdvice, and use RFC 9457 ProblemDetail for 400, 404 and 409 responses.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    The DTO has @NotBlank on title but the controller parameter lacks @Valid. What happens with an empty title?

  2. Question 2

    Which status suits "the course is already full"?

  3. Question 3

    What is @RestControllerAdvice for?

  4. Question 4

    Which annotation rejects a string that is null, empty or only spaces?

  5. Question 5

    What content type do ProblemDetail error responses use?