Hi, is it necessary to put @VisibleForTesting if y...
# test
p
Hi, is it necessary to put @VisibleForTesting if you put a method internal? what whould be the difference between using @VisibleForTesting or not? the guide I'm doing recommends you to combine "internal" and "@VisibleForTesting" but I can see that simply putting "internal" makes the method visible for the test class and packages, so I don't understand whats the purpose of combining @VisibleForTesting with "internal" on a method
r
A linter could warn you in case you call the method not only from tests but also from other classes in the same module. But first you need a linter which warns you, otherwise internal has the bigger effect than
@VisibleForTesting