android - @VisibleForTesting does not work as expected -
i wanted try @visiblefortesting annotation android unit-test - have class 1 annotated method:
public class foo { public void bar() { } @visiblefortesting private void baz() { } }
but in unit-tests still can see bar - not baz
the point of annotation convention , used in static code analysis.
change visibility of method package
. in case method has reduced visibility testing , visible tests in same package.
public class foo { public void bar() { } @visiblefortesting /* package */ void baz() { } }
Comments
Post a Comment