-
Notifications
You must be signed in to change notification settings - Fork 42
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
Generate assertions for Java records #212
Comments
Records are supported, but through a hack: import org.assertj.assertions.generator.GenerateAssertion;
@GenerateAssertion
public record Item(String name, Integer value) {} If you add the @javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractItemAssert<S extends AbstractItemAssert<S, A>, A extends Item> extends AbstractObjectAssert<S, A> {
protected AbstractItemAssert(A actual, Class<S> selfType) {...}
public S hasHashCode(int hashCode) {...}
public S hasName(String name) {...}
public S hasToString(String toString) {...}
public S hasValue(Integer value) {...}
} But there are three disadvantages:
|
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: