Class EmailMessage
- java.lang.Object
-
- org.apache.sling.testing.clients.email.EmailMessage
-
public final class EmailMessage extends java.lang.ObjectHolds information retrieved from the mock SMTP server deployed in Sling
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHEADER_FROMstatic java.lang.StringHEADER_SUBJECTstatic java.lang.StringHEADER_TO
-
Constructor Summary
Constructors Constructor Description EmailMessage(java.lang.String content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(java.lang.String key, java.lang.String value)Adds a new header to this email messagejava.lang.StringgetContent()Returns the contents of the emailjava.lang.StringgetHeader(java.lang.String key)Returns the value of one of the headers of this emailjava.util.Map<java.lang.String,java.lang.String>getHeaders()Returns an unmodifiable view over the email headers
-
-
-
Field Detail
-
HEADER_FROM
public static final java.lang.String HEADER_FROM
- See Also:
- Constant Field Values
-
HEADER_TO
public static final java.lang.String HEADER_TO
- See Also:
- Constant Field Values
-
HEADER_SUBJECT
public static final java.lang.String HEADER_SUBJECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
addHeader
public void addHeader(java.lang.String key, java.lang.String value)Adds a new header to this email message- Parameters:
key- the header namevalue- the header value
-
getHeader
public java.lang.String getHeader(java.lang.String key)
Returns the value of one of the headers of this email- Parameters:
key- the header name- Returns:
- the value of the header, possibly
null
-
getHeaders
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
Returns an unmodifiable view over the email headers- Returns:
- the headers
-
getContent
public java.lang.String getContent()
Returns the contents of the email- Returns:
- the email content
-
-