Add check that verifies public or protected methods do not take private or internal parameters
#1015 fixed an issue where a public annotation had a public constructor that had a package-private enum parameter. This didn't break immediately, but caused issue for mocking. If it were a more generally used method, that method would be visible but not callable.
We should add an ArchUnit tests that:
- find all public methods and verifies that all parameters of those method are also public
- find all protected methods and verify that all parameters of those method are also at least protected - might be harder to write this test
- find all public classes and verify they extend public classes - this may or may not be strictly required, but it makes for better testing and clarity.
Consider https://siom79.github.io/japicmp/ to flag/prevent breaking API changes.
JApiCmp added in #1398. This does not address the issue noted in the title. For that we will need a tool like RevApi or might be able to check this kind of problem via ArchUnit since it is not a surface area change problem, but a basic API correctness issue.