Package com.perfectcorp.annotation
Annotation Type VisibleForTesting
-
@Retention(SOURCE) public @interface VisibleForTestingDenotes 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 Fields Description static intNONEThe annotated element should never be called from production code, only from tests.static intPACKAGE_PRIVATEThe annotated element would have "package private" visibilitystatic intPRIVATEThe annotated element would have "private" visibilitystatic intPROTECTEDThe annotated element would have "protected" visibility
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intotherwiseThe visibility the annotated element would have if it did not need to be made visible for testing.
-