Skip to content
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 rule checking test and implementation class are in same package #908

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

mslowiak
Copy link
Contributor

@mslowiak mslowiak commented Jul 11, 2022

This will add the library rule GeneralCodingRules.testClassesShouldResideInTheSamePackageAsImplementation(..) which will test that implementation and test class reside in the same package. The rule can e.g. detect mismatches like com.myapp.correct.SomeClass and com.myapp.wrong.SomeClassTest.

Resolves: #475

Signed-off-by: Marcin Słowiak <marcin.slowiak.007@gmail.com>
@codecholeric codecholeric changed the title Issue #475: Implement ArchRule that checks if test class reside in the same package as implementation class Add rule checking test and implementation class are in same package Jul 13, 2022
@codecholeric
Copy link
Collaborator

Thanks a lot for your contribution!! 😄 Looks very good in general 👍 I just made some small adjustments, mainly

  • adjust the message a little to be more consistent with other messages
  • use common testing infrastructure to test the rule

I just adjusted it, since I want to release these days, so I cut down the round trip a little. I hope that's okay with you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

General rule to test that class and its test are both at the same package
2 participants