Open maciejwalkowiak opened 1 year ago
We are currently focusing on the next release for AssertJ. As soon as that is done, we'll revamp the generator projects and address these additional topics.
Hi @Berlizov,
I cannot make your hack work in my example project (using the gradle plugin for the generator), am I missing something?
The job summary shows the generated file: https://github.com/timo-a/microservice-example/actions/runs/10048164798
I'm just running generateAssertJ
to sidestep the javax annotations that would cause a build
to fail.
Locally, I'm running $ ./gradlew :generateAssertJ
, PRs against the branch demo/assertj/records-workaround-with-annotation will trigger a new run.
Update: I tried it with the maven plugin as well, to no avail (I hope I'm overlooking something). As before in gradle: The job summary shows the generated file: https://github.com/timo-a/debug-assertj-maven-plugin/actions/runs/10125183976, repository to reproduce, PRs against demo/assertj/records-workaround-with-annotation will trigger a rerun.
Locally the commands are mvn compile; mvn assertj:generate-assertions
.
We are currently focusing on the next release for AssertJ. As soon as that is done, we'll revamp the generator projects and address these additional topics.
I don't mean to create any pressure @scordio, I appreciate what is there already, I'm busy myself and cannot promise to contribute anything either. However, seeing as there has been a new release since your comment, and there is a PR for this issue already, is there anything outside contributors can do to speed up the resolution of this particular issue? Maybe tackle a number of higher priority issues?
While not as important as the core, I think that in the scope of custom assertion generation this is a key issue for projects with Java 17+ as a lot of the types to generate custom assertions for can be records.
@timo-a yes, definitely. Such issues are not forgotten 🙂
We couldn't spare time for the generator in the last months but I plan to jump on it in August.
Team decision: We will start the development of the next major version with Java 17 as a baseline to better aid records and jakarta support.
Gentle check-in, is there something outside contributors can help to get this issue resolved? Does the java 17 baseline for instance imply any steps to be taken, like updating the workflow?
Thanks for the offer, @timo-a! We're already working on it.
Records are supported, but through a hack:
If you add the
@GenerateAssertion
, it generates a full Assert class:But there are three disadvantages:
hasHashCode
andhasToString
methods. But of course, all standard AbstractAssert's methods such asasString
remain.