-
Notifications
You must be signed in to change notification settings - Fork 299
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
ArchUnit rule for package consistency for test classes #20
Comments
I think there are several ways to test this. I don't know, if you really need the fluent API for this use case, so you could just do this test on a lower level: (for the case of simplicity, I'll assume that the simple name is unique and no class is called sth. like 'FooTestTest' or just 'Test')
You'll probably have to refine this a little more, for example you could consider 'JavaClass.getSource()' to find out if the class you're checking is in If you want to use the fluent API at all costs 😉 , you could initialize a custom condition by overriding
(of course it would look neater, if the condition was declared in a separate method) |
Can you give me an update, if you were able to figure out your issue? (Because then I could close this issue 😉 ) |
Many thanks for coming back to this. Your provided solution is working for us! |
After some refactorings, I want to ensure that all (.*)Test classes reside in the same package as their corresponding classes-under-test. How to achieve this with ArchUnit?
The text was updated successfully, but these errors were encountered: