If you're writing tests for Spring's @ControllerAdvice or @ExceptionHandler methods, this walks you through the MockMvc setup that actually works. The key trick is calling setControllerAdvice() on your standalone builder, which people constantly forget and then wonder why their handler never fires. It covers the usual suspects: asserting status codes, validating JSON error payloads with jsonPath, and testing MethodArgumentNotValidException for field-level validation errors. The examples are concrete enough to copy and adapt. One nice touch is the debugging tip to chain andDo(print()) when assertions fail so you can see what's actually coming back. Saves you from guessing why your 404 handler is returning 200.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-exception-handler