Skip to content

AbstractJsonContentAssert should allow satistfies to run on the json content, not the raw string #32894

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

Closed
snicoll opened this issue May 24, 2024 · 0 comments
Assignees
Labels
in: test Issues in the test module type: bug A general bug
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented May 24, 2024

AbstractJsonContentAssert is currently a AbstractStringAssert which means that satisfies run on the raw String. So we can't write something like assertThat(json).satisfies(content -> assertThat(content)....

Besides, being a AbstractStringAssert means we have the regular isEqualTo that takes a String and doesn't have the semantic of checking if the string ends with .json to load a file. It would be much less confusing if we stop inheriting from all these methods.

Perhaps an asJsonString could help getting back the raw text if that's really necessary down the road.

@snicoll snicoll added in: test Issues in the test module type: bug A general bug labels May 24, 2024
@snicoll snicoll added this to the 6.2.0-M4 milestone May 24, 2024
@snicoll snicoll self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant