acidjnkhello - in my Spring Boot application, I want to have defensive code in the @ControllerAdvice inheriting from ResponseEntityExceptionHandler for "can't happen" situations. Like an actual bug that causes an unexpected exception, forgotten validation of client data. Would you rather make a unit test with mocking, or add a special endpoint class only to src/test that generates all exceptions needed for @SpringBootTest?
* jamezp joined #java
* mwnaylor joined #java
sonOfRaI wouldn't write a test for this thing, I would just assume that whatever Spring gives you for unhandled exception handling actually works
* WizJin joined #java
acidjnkI find that unsatisfying for clients, like an Angular or React application, for example. They need to rely on an API contract, e. g. that I provide certain fields in the response object so they can display the proper error message.
acidjnkAlthough could argue that the client should expect 500 and so something proper with it, no matter what else it contains.
* ztevoz joined #java
* hwpplayer1 joined #java
* overholts009 joined #java
* mwnaylor joined #java
ernimrilacidjnk, there are typically many things between your server and the client all of them can crash or rewrite the content....
ernimrilacidjnk, a client that does not handle 500 responses is not a good client
* gurrkin joined #java
* Anaphaxaway joined #java
* sponkz joined #java
* mindCrime joined #java
* magla joined #java
* bdkl joined #java
* Ragnor joined #java
* ne555 joined #java
* tomaw_ joined #java
* mwnaylor joined #java
* leppard joined #java
* domicron7 joined #java
* metalmaniac joined #java
* viju joined #java
* jjakob joined #java
* acidjnk_new joined #java
* JurassCZ joined #java
* lucerne90 joined #java
acidjnkthis is not really readable, is it? https://pastebin.com/6KyRWJ9L elegant in a way, but with Java syntax, not clear that it is a simple carthesian product of (GET,PUT)x(thing1,thing2,thing3,...)