1   package com.atlassian.user.impl.ldap;
2   
3   import com.atlassian.user.security.authentication.Authenticator;
4   
5   public abstract class AbstractTestLdapAuthenticator extends AbstractLdapTest
6   {
7       private Authenticator authenticator;
8   
9       public void testAuthenticate() throws Exception
10      {
11          for (int i = 1; i <= 8; i++)
12          {
13              assertTrue(authenticator.authenticate("user" + i, "pass" + i));
14          }
15      }
16  
17      public void testLoginWorksAfterUnsuccessfulLogin() throws Exception
18      {
19          for (int i = 1; i <= 8; i++)
20          {
21              assertFalse(authenticator.authenticate("user" + i, "badpassword"));
22              assertTrue(authenticator.authenticate("user" + i, "pass" + i));
23          }
24      }
25  
26      public void setLdapAuthenticator(Authenticator ldapAuthenticator)
27      {
28          this.authenticator = ldapAuthenticator;
29      }
30  }