Class MockMailer

  • All Implemented Interfaces:
    Mailer

    public class MockMailer
    extends java.lang.Object
    implements Mailer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Map<java.lang.String,​java.util.List<Mail>> mails  
    • Constructor Summary

      Constructors 
      Constructor Description
      MockMailer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String domain()
      Returns the domain this is configured to use.
      java.util.List<Mail> inbox​(java.lang.String recipient)
      Returns the list of mails sent to the given recipient.
      void send​(Mail mail)
      Sends the given mail as the configured user@domain.
      java.lang.String user()
      Returns the user this is configured to use.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mails

        public final java.util.Map<java.lang.String,​java.util.List<Mail>> mails
    • Constructor Detail

      • MockMailer

        public MockMailer()
    • Method Detail

      • send

        public void send​(Mail mail)
        Description copied from interface: Mailer
        Sends the given mail as the configured user@domain.
        Specified by:
        send in interface Mailer
      • user

        public java.lang.String user()
        Description copied from interface: Mailer
        Returns the user this is configured to use.
        Specified by:
        user in interface Mailer
      • domain

        public java.lang.String domain()
        Description copied from interface: Mailer
        Returns the domain this is configured to use.
        Specified by:
        domain in interface Mailer
      • inbox

        public java.util.List<Mail> inbox​(java.lang.String recipient)
        Returns the list of mails sent to the given recipient. Modifications affect the set of mails stored in this.