Skip to content

Improve WebIntegrationTest output for server errors #964

Description

@dennisvang

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    devRelated to development, e.g. code style, refactoring, github workflows, etc.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions