Allow clients to assert the webTestClient response status #778
Labels
in: test
Issues related to the test module
status: declined
A suggestion or change that we don't feel we should currently apply
Hi! I have a Spring Boot that exposes a GraphQL API, and it's secured with LDAP. Now, I am implementing some test cases using
HttpGraphQlTester
.The problem I am facing is when I inform invalid credentials.
For instance, let's suppose that a valid user has the username
app-user
and password123
.All good when I call
I get 200 and the response;
The same happens when I do not inform the credentials
I get 200 and the error in my response;
However, when informing invalid credentials
I get 401 and the test fails.
Checking the library code, I've seen that we are asserting the
webClientTest
response to be.expectStatus().isOk()
.Is it (or would it be) possible to not assert inside the library and let the clients assert in their test cases?
Best regards,
The text was updated successfully, but these errors were encountered: