← All topics
Quiz: Validation and Errors: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. The DTO has @NotBlank on title but the controller parameter lacks @Valid. What happens with an empty title?
- Q2. Which status suits "the course is already full"?
- Q3. What is @RestControllerAdvice for?
- Q4. Which annotation rejects a string that is null, empty or only spaces?
- Q5. What content type do ProblemDetail error responses use?
- Q6. Why is @NotNull on a primitive int fee field pointless?
- Q7. Which exception does Spring throw when a @Valid @RequestBody DTO fails its constraints?
- Q8. Why did the Course API store field errors in a TreeMap?
- Q9. What should a client receive when your code hits an unexpected bug?
- Q10. Which annotation checks a string against a regular expression?