I´m running pure JUnit4 java tests over my pure java files on my project but I can\'t find a way to use @VisibleForTesting clearly without making the thing manually public.
The Tag itself helps with the linter to identify unwanted access.
To lower the risk of use it directly, add this methods as internal
in Kotlin or protected
in Java instead of public
and with that only the tests or classes that are in the same package will be able to access that method.
Java:
@VisibleForTesting
protected Address address() {
return mAddress;
}
Kotlin:
@VisibleForTesting
internal fun address(): Address {
return address;
}