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
hasPermittedSubclasses
and hasNoPermittedSubclasses
for Class
assertions
#3263
Comments
@scordio Can I contribute to this one? |
Sure and thanks, @pbacz! |
@scordio In light of this, I would like to seek your input on the following questions:
|
You're referring to
That's absolutely correct when the object under test is a sealed class. However,
We might have a testing strategy similar to how we tested Would that make sense? |
Yes, I added the clarification in my previous comment.
Sure, but this would effectively make
Of course, but this only tests a case when getPermittedSubclasses() returns null. What about a case when getPermittedSubclasses() returns an ampty array?
Ok, I can see from the convention in |
@pbacz I propose we add only WDYT? |
@scordio I think it's fine. I'll do it this way. |
@scordio |
We should add
hasPermittedSubclasses(Class<?>...)
andhasNoPermittedSubclasses()
toClass
assertions, followingClass::getPermittedSubclasses
.As we still target Java 8, the implementation should be reflection-based, similar to #3080.
The text was updated successfully, but these errors were encountered: