How to use VisibleForTesting for pure JUnit tests

后端 未结 4 897
南旧
南旧 2021-02-01 03:27

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.

4条回答
  •  Happy的楠姐
    2021-02-01 03:36

    @VisibleForTesting annotation is used in package-methods in Guava, and does not part of JUnit API. The annotation is just a tag to indicate the method can be tested. It even doesn't be loaded in JVM.

提交回复
热议问题