Annotation Interface TestOnly


@Documented public @interface TestOnly
Annotation indicating that the annotated element is intended for testing purposes only.

This annotation can be applied to fields, methods, and constructors to signify that they should only be used within test code and not in production code.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional description providing context about the testing usage.
  • Element Details

    • value

      String value
      Optional description providing context about the testing usage.

      This can include reasons for the testing designation or any relevant notes.

      Returns:
      a string description (default is an empty string)
      Default:
      ""