-
- All Implemented Interfaces:
-
java.lang.annotation.Annotation
@Retention(value = ) public @interface VisibleForTesting
Denotes that the class, method or field has its visibility relaxed, so that it is more widely visible than otherwise necessary to make code testable.
You can optionally specify what the visibility should have been if not for testing; this allows tools to catch unintended access from within production code.
Example:
If not specified, the intended visibility is assumed to be private.@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) public String printDiagnostics() { ... }
-
-
Field Summary
Fields Modifier and Type Field Description public final static intPRIVATEpublic final static intPACKAGE_PRIVATEpublic final static intPROTECTEDpublic final static intNONE
-
Method Summary
Modifier and Type Method Description abstract intotherwise()The visibility the annotated element would have if it did not need to be made visible fortesting. -
-
Method Detail
-
otherwise
abstract int otherwise()
The visibility the annotated element would have if it did not need to be made visible fortesting.
-
-
-
-