I have two exception handlers in my code: one for BindException
and another for MethodArgumentNotValidException
. In my tests, I’m unable to find a way to trigger the Spring framework to throw a BindException
.
Examples I’ve found online, such as setting validation on endpoint parameters, no longer throw a BindException
but instead the MethodArgumentNotValidException
.
I’ve also noticed that exception handlers have now removed handling BindException
since 6.2, leading me to question if it ever needs handling in its raw form.
I have found that DefaultServerRequest
and WebRequestDataBinder
do throw a BindException
, but it’s unclear to me how I can trigger this in my test setup.