Class SlingEmailClient
- java.lang.Object
-
- org.apache.sling.testing.clients.AbstractSlingClient
-
- org.apache.sling.testing.clients.SlingClient
-
- org.apache.sling.testing.clients.email.SlingEmailClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.http.client.HttpClient
public final class SlingEmailClient extends SlingClient
Accesses email stored by a mock SMTP server deployed to SlingRequires that the
org.apache.sling.testing.email
bundle is deployed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.sling.testing.clients.SlingClient
SlingClient.Builder, SlingClient.InternalBuilder<T extends SlingClient>
-
-
Field Summary
-
Fields inherited from class org.apache.sling.testing.clients.SlingClient
CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE
-
-
Constructor Summary
Constructors Constructor Description SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteMessages()
Deletes all mail messages currently storedint
getBindPort()
Retrieves the actual bind port of the SMTP serverjava.util.List<EmailMessage>
getMessages()
Retrieves the list of mail messages currently stored-
Methods inherited from class org.apache.sling.testing.clients.SlingClient
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
-
Methods inherited from class org.apache.sling.testing.clients.AbstractSlingClient
adaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getUser, getValue, getValues, hasValue
-
-
-
-
Constructor Detail
-
SlingEmailClient
public SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config) throws ClientException
- Throws:
ClientException
-
-
Method Detail
-
getBindPort
public int getBindPort() throws ClientException
Retrieves the actual bind port of the SMTP server- Returns:
- the port value
- Throws:
ClientException
- in case of any errors
-
getMessages
public java.util.List<EmailMessage> getMessages() throws ClientException
Retrieves the list of mail messages currently stored- Returns:
- the list of messages, possibly empty
- Throws:
ClientException
- in case of any errors
-
deleteMessages
public void deleteMessages() throws ClientException
Deletes all mail messages currently stored- Throws:
ClientException
- in case of any errors
-
-