Class EmailMessage
- java.lang.Object
-
- org.apache.sling.testing.clients.email.EmailMessage
-
public final class EmailMessage extends Object
Holds information retrieved from the mock SMTP server deployed in Sling
-
-
Field Summary
Fields Modifier and Type Field Description static String
HEADER_FROM
static String
HEADER_SUBJECT
static String
HEADER_TO
-
Constructor Summary
Constructors Constructor Description EmailMessage(String content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(String key, String value)
Adds a new header to this email messageString
getContent()
Returns the contents of the emailString
getHeader(String key)
Returns the value of one of the headers of this emailMap<String,String>
getHeaders()
Returns an unmodifiable view over the email headers
-
-
-
Field Detail
-
HEADER_FROM
public static final String HEADER_FROM
- See Also:
- Constant Field Values
-
HEADER_TO
public static final String HEADER_TO
- See Also:
- Constant Field Values
-
HEADER_SUBJECT
public static final String HEADER_SUBJECT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmailMessage
public EmailMessage(String content)
-
-
Method Detail
-
addHeader
public void addHeader(String key, String value)
Adds a new header to this email message- Parameters:
key
- the header namevalue
- the header value
-
getHeader
public String getHeader(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 Map<String,String> getHeaders()
Returns an unmodifiable view over the email headers- Returns:
- the headers
-
getContent
public String getContent()
Returns the contents of the email- Returns:
- the email content
-
-