-
Notifications
You must be signed in to change notification settings - Fork 298
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
Add (not)haveFullyQualifiedNameAnyOf
to API
#1114
base: main
Are you sure you want to change the base?
Add (not)haveFullyQualifiedNameAnyOf
to API
#1114
Conversation
|
||
assertThatTypes(classes).matchInAnyOrder(ClassAccessedByFoo.class, Foo.class); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tests to the best of my knowledge, and as ClassesThatTestsExistTest
instructed me. Please let me know if there are any tests missing, I'm not sure this is enough. (feel free to just fix them yourself if it's easier that way 👍)
The tests added are trivial since I could just copy existing single-haveFullyQualifiedName
tests.
Signed-off-by: Per Lundberg <[email protected]>
024ac91
to
babfa5f
Compare
@hankem @codecholeric Please let me know what to do to push this forward. I guess understanding why the tests are failing would be a good first thing. 😄 |
@hankem @codecholeric Ping, please help me push this towards completion. |
I'm really sorry! These are crazy times... it's nothing with your PR, but I was occupied with several other projects that didn't allow me to follow up more with ArchUnit than a bare minimum. I know, it's a bad excuse, but I can only say that you're not forgotten. |
Sorry for the late answer! There's just a couple of things coming to my mind. |
Use case: we wanted to do some whitelisting of certain classes for a particular check, deprecating all usage of a given Java package (
org.joda.time
). We couldn't use existing predicates for this because:areAssignableFrom
andareAssignableTo
only operate on a single class.assignableFrom
is unsuitable for one of our checks since that would implicitly whitelist the base class.belongToAnyOf
which would be more correct, but it has to be combined withareNotNestedClasses
in that case to avoid running checks on nested classes. (We run both a "normal" test for the whitelisted classes to allow them to use the deprecated package, but also an "inverted" test to ensure classes don't remain whitelisted when they no longer use the deprecated code. I don't remember if this worked or not, but either way, it feels more complex to have to jump through hoops to do an "exact" check for multiple whitelisted classes)Hence, the suggested new additions to the API in this PR.