Annotation Type VisibleForTesting


  • @Documented
    @Target({TYPE,CONSTRUCTOR,METHOD,FIELD})
    public @interface VisibleForTesting
    Annotates a program element that exists, or is more widely visible than otherwise necessary, only for use in test code.

    Introduced while mobbing with Michael Feathers. Name and javadoc borrowed from Guava and AssertJ (both are Apache License 2.0).

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String value
      Optional description
    • Element Detail

      • value

        java.lang.String value
        Optional description
        Returns:
        the description for this annotation
        Default:
        ""