Class 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 Sling

    Requires that the org.apache.sling.testing.email bundle is deployed.

    • 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