spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.69k stars 38.14k forks source link

Include Spring Boot's JacksonTester in the test module #24519

Open odrotbohm opened 4 years ago

odrotbohm commented 4 years ago

Spring Boot ships JacksonTester (see Boot's reference docs) that's very handy to formulate assertions on Jackson rendered payloads. That kind of functionality is very helpful for tests in Spring projects that deal with Jackson serialization (Spring HATEOAS, Spring Data REST) and it doesn't look like the class is tied to Boot in any way.

That said, it refers to AssertJ as assertion library but there seem to be quite a few themes regarding the integration of AssertJ APIs in e.g. MockMVC already.

bclozel commented 2 years ago

We've discussed this issue as a team and we think that while this feature would be a nice addition to our testing support, we don't think that it's worth investing in it right now. This feature has been available in Spring Boot for a while now and as you've pointed out, this also requires a broader adoption of AssertJ in our testing support.

We'll turn this issue into a documentation improvement - we should add a new section in the Integration testing reference documentation to cross-link to the Spring Boot support.

We might revisit this decision in the future, if and once AssertJ adoption is broader in spring-test.

odrotbohm commented 6 months ago

Now that AssertJ testing support has landed in 6.2, is it worth reconsidering this?