Tests like org.fairdatateam.fairdatapoint.acceptance.general.ContentNegotiationTest#getContentAccordingToFormatQueryString which extend WebIntegrationTest produce very unhelpful output in case of server error (status 500).
|
assertThat(result.getStatusCode(), is(equalTo(HttpStatus.OK))); |
The actual exception that causes the server error is not displayed, and often does not even turn up if we set test logging levels to debug or trace.
This severely complicates debugging.
To improve this situation, we could configure a filter that catches the server exception, stores it in the test class, and then re-throws. The test class can then display the server exception when a status 500 is returned.
Tests like
org.fairdatateam.fairdatapoint.acceptance.general.ContentNegotiationTest#getContentAccordingToFormatQueryStringwhich extendWebIntegrationTestproduce very unhelpful output in case of server error (status 500).FAIRDataPoint/src/test/java/org/fairdatateam/fairdatapoint/acceptance/general/ContentNegotiationTest.java
Line 72 in e28226c
The actual exception that causes the server error is not displayed, and often does not even turn up if we set test logging levels to
debugortrace.This severely complicates debugging.
To improve this situation, we could configure a filter that catches the server exception, stores it in the test class, and then re-throws. The test class can then display the server exception when a status 500 is returned.