Annotation Interface Attachment


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface Attachment
Used to mark methods that produce attachments. Returned value of such methods will be copied and shown in the report as attachment.

Byte arrays are used as binary attachment content directly. Custom return types may implement AttachmentBytes; all other values are converted to their UTF-8 string representation.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional attachment file extension.
    Valid attachment MimeType, for example "text/plain" or "application/json".
    The attachment name.
  • Element Details

    • value

      String value
      The attachment name.
      Returns:
      the attachment name.
      Default:
      ""
    • type

      String type
      Valid attachment MimeType, for example "text/plain" or "application/json".
      Returns:
      the attachment type.
      Default:
      ""
    • fileExtension

      String fileExtension
      Optional attachment file extension. By default file extension will be determined by provided media type. Should be started with dot.
      Returns:
      the attachment file extension.
      Default:
      ""