@Test public void testMakeOneUserAuthenticator() throws Exception { Authenticator a = loader.makeAuthenticator("bob:uncle"); assertTrue(a instanceof OneUserAuthenticator); OneUserAuthenticator oua = (OneUserAuthenticator) a; assertEquals("bob", oua.getUser()); assertEquals("uncle", oua.getPassword()); }
@Test public void testMakeMultiUserAuthenticator() throws Exception { final String passwordFilename = "testpasswd"; File passwd = new File(passwordFilename); passwd.createNewFile(); Authenticator a = loader.makeAuthenticator(passwordFilename); assertTrue(a instanceof MultiUserAuthenticator); passwd.delete(); }
@Test public void testMakeNullAuthenticator() throws Exception { Authenticator a = loader.makeAuthenticator(null); assertTrue(a instanceof PromiscuousAuthenticator); }