1   /*
2    * Created by IntelliJ IDEA.
3    * User: owen
4    * Date: Dec 6, 2002
5    * Time: 1:41:02 PM
6    * CVS Revision: $Revision: 1.2 $
7    * Last CVS Commit: $Date: 2003/09/30 07:27:55 $
8    * Author of last CVS Commit: $Author: mcannon $
9    * To change this template use Options | File Templates.
10   */
11  package test.mock.mail;
12  
13  import javax.mail.Authenticator;
14  import javax.mail.PasswordAuthentication;
15  
16  public class MockAuthenticator extends Authenticator
17  {
18      private String username;
19      private String password;
20  
21      public MockAuthenticator(String username, String password)
22      {
23          this.username = username;
24          this.password = password;
25      }
26  
27      public PasswordAuthentication getPasswordAuthentication()
28      {
29          return new PasswordAuthentication(getUsername(), getPassword());
30      }
31  
32      public String getUsername()
33      {
34          return username;
35      }
36  
37      public String getPassword()
38      {
39          return password;
40      }
41  }