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:
Closeable
,AutoCloseable
,org.apache.http.client.HttpClient
Accesses email stored by a mock SMTP server deployed to Sling
Requires 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, SUDO_COOKIE_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionSlingEmailClient
(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes all mail messages currently storedint
Retrieves the actual bind port of the SMTP serverRetrieves the list of mail messages currently storedMethods inherited from class org.apache.sling.testing.clients.SlingClient
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, endImpersonation, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUser, getUUId, getUUID, impersonate, 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, getValue, getValues, hasValue
-
Constructor Details
-
SlingEmailClient
public SlingEmailClient(org.apache.http.impl.client.CloseableHttpClient http, SlingClientConfig config) throws ClientException - Throws:
ClientException
-
-
Method Details
-
getBindPort
Retrieves the actual bind port of the SMTP server- Returns:
- the port value
- Throws:
ClientException
- in case of any errors
-
getMessages
Retrieves the list of mail messages currently stored- Returns:
- the list of messages, possibly empty
- Throws:
ClientException
- in case of any errors
-
deleteMessages
Deletes all mail messages currently stored- Throws:
ClientException
- in case of any errors
-