Skip to content

add onFailMessage into validatable response#1724

Merged
johanhaleby merged 1 commit intorest-assured:masterfrom
groov1kk:add-on-fail-message
Sep 5, 2023
Merged

add onFailMessage into validatable response#1724
johanhaleby merged 1 commit intorest-assured:masterfrom
groov1kk:add-on-fail-message

Conversation

@groov1kk
Copy link
Copy Markdown
Contributor

@groov1kk groov1kk commented Sep 3, 2023

Fix for the #1548

Added method onFailMessage into ValidatableResponseOptions to add possibility overriding an error message from then section:

when().
       get("/lotto").
then().
       onFailMessage("An additional information to find the cause of the error").
       body("lotto.lottoId", lessThan(2));

UPD: Here is a link to the documentation with mistake which was discussed in the issue topic.

@johanhaleby johanhaleby merged commit 8e9b0d0 into rest-assured:master Sep 5, 2023
@johanhaleby
Copy link
Copy Markdown
Collaborator

I thought that this already worked!! But it seems like it only worked for expect and not for then. Great find, and thanks for PR!

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