Skip to content

Added ability to test for specific HTTP response status code - #16

Merged
adamwojs merged 4 commits into
4.6from
feature/non-200-status-code-assert
Aug 21, 2025
Merged

Added ability to test for specific HTTP response status code#16
adamwojs merged 4 commits into
4.6from
feature/non-200-status-code-assert

Conversation

@alongosz

Copy link
Copy Markdown
Member
🎫 Issue n/a

Related PRs:

Description:

If a REST endpoint returns non-200 HTTP status code, e.g.: 201 (Created) or 204 (No Content) it's good to test that the response returns that actual code rather than checking if the response was just successful (HTTP statuses >=200 and <300).

This PR adds that ability by adding yet another property to the EndpointRequestDefinition SPI. If not given, the current behavior of checking for a success is preserved. While it mostly applies to other success statuses, it can be applied to checking a contents of a 401, 403, 404, etc., responses.

See either the test coverage or the related PR for the usage.

For QA:

No QA required

Documentation:

@adamwojs
adamwojs merged commit 7587127 into 4.6 Aug 21, 2025
7 checks passed
@adamwojs
adamwojs deleted the feature/non-200-status-code-assert branch August 21, 2025 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants