Fixed issue #42

This commit is contained in:
selva.andre
2014-05-05 22:53:42 +02:00
parent 4d2bf38a66
commit 8a7db6ee15
6 changed files with 28 additions and 11 deletions
@@ -13,7 +13,7 @@ public class FileAuthenticatorTest {
@Test
public void loadPasswordFile_verifyValid() {
String file = getClass().getResource("/password_file.conf").getPath();
IAuthenticator auth = new FileAuthenticator(file);
IAuthenticator auth = new FileAuthenticator(null, file);
assertTrue(auth.checkValid("testuser", "passwd"));
}
@@ -21,8 +21,16 @@ public class FileAuthenticatorTest {
@Test
public void loadPasswordFile_verifyInvalid() {
String file = getClass().getResource("/password_file.conf").getPath();
IAuthenticator auth = new FileAuthenticator(file);
IAuthenticator auth = new FileAuthenticator(null, file);
assertFalse(auth.checkValid("testuser2", "passwd"));
}
@Test
public void loadPasswordFile_verifyDirectoryRef() {
IAuthenticator auth = new FileAuthenticator("", "");
assertFalse(auth.checkValid("testuser2", "passwd"));
}
}