As of now using @ResponseStatus annotations on custom exceptions or exception handler methods of @ControllerAdvice classes is not supported.
This is a pitfall when coming from the classic web stack where this is kind of the idiomatic way to apply specific response codes to custom exceptions.
Either using ResponseStatusException directly or applying a wrapper (e.g. through a @ControllerAdvice) is a workaround but feels like it is something the framework should do.
As described in this comment this seems easily doable through the ResponseStatusExceptionHandler.
A small test setup is attached to this ticket. Running ./gradlew test currently fails as the response status for the custom exception is not set to 400 but by default to 500.
Just to be clear, we're talking about support for built-in handling of @ResponseStatus-annotated exceptions, in the same way that ResponseStatusException is already handled, correct? Keep in mind that is unrelated to @ControllerAdvice which is for explicit handling of exceptions by the application.