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

Override JsonPathAssertions "equals" method to fail always [SPR-17091] #21628

Closed
spring-issuemaster opened this issue Jul 26, 2018 · 1 comment
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jul 26, 2018

Henning Vogt opened SPR-17091 and commented

org.springframework.test.web.reactive.server.JsonPathAssertions does not have an equals method, thus this Unit-test will always pass:

ResponseSpec spec = this.client.get().uri("/aaa/select?q=*:*").exchange();
 spec.expectStatus().is4xxClientError().expectBody()
 .jsonPath("$.message").equals("test");

I'd suggest to override equals in JsonPathAssertions, makin it "fail()" always, pointing the user to the correct isEqualTo() method. (probably throw an AssertionError or something like that...?)


Affects: 5.0.7

Referenced from: commits fcbf06f

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 27, 2018

Rossen Stoyanchev commented

Okay I've done just that for JSON and XML assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.