Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JaxrsExceptionTestHelper#assertContainsError should report actual errors #376

Closed
sleberknight opened this issue Mar 27, 2023 · 0 comments · Fixed by #380
Closed

JaxrsExceptionTestHelper#assertContainsError should report actual errors #376

sleberknight opened this issue Mar 27, 2023 · 0 comments · Fixed by #380
Assignees
Labels
enhancement A request for change or improvement to an existing feature
Milestone

Comments

@sleberknight
Copy link
Member

JaxrsExceptionTestHelper#assertContainsError(response, statusCode, substring) reports an error when a Response does not have the given HTTP status code and does not contain an ErrorMessage whose message contains the given substring. For example:

java.lang.AssertionError: Response does not contain an ErrorMessage having status 422 and message containing: must occur before End Time

However, it does not provide any information about what it actually contains, which is needed to help determine what went wrong. Without this information the only way I have found is to use the debugger to inspect the actual ErrorMessage(s).

This task is to enhance the method with information about the actual ErrorMessage(s) that were found in the Response, or none if there weren't any. The information should include all the information from the ErrorMessage(s) - status code, field name, item ID, and message.

@sleberknight sleberknight added the enhancement A request for change or improvement to an existing feature label Mar 27, 2023
@sleberknight sleberknight added this to the 2.3.3 milestone Mar 27, 2023
@sleberknight sleberknight self-assigned this Mar 27, 2023
sleberknight added a commit that referenced this issue Apr 1, 2023
* Change the error message reported by assertContainsError so that it
  reports the expected ErrorMessage and also all the actual errors. This
  will allow users to determine the problem by having the actual errors
  for inspection.

Closes #376
chrisrohr pushed a commit that referenced this issue Apr 1, 2023
…ors (#380)

* Change the error message reported by assertContainsError so that it
  reports the expected ErrorMessage and also all the actual errors. This
  will allow users to determine the problem by having the actual errors
  for inspection.

Closes #376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for change or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant