use of org.apache.sling.auth.core.spi.AuthenticationInfo in project sling by apache.
the class AuthenticationInfoTest method testAuthenticationInfoStringStringCharArrayString.
@Test
public void testAuthenticationInfoStringStringCharArrayString() {
final char[] pwd = new char[6];
final AuthenticationInfo info = new AuthenticationInfo("test", "name", pwd);
Assert.assertEquals("test", info.getAuthType());
Assert.assertEquals("name", info.getUser());
assertSame(pwd, info.getPassword());
}
use of org.apache.sling.auth.core.spi.AuthenticationInfo in project sling by apache.
the class AuthenticationInfoTest method testAuthenticationInfoStringStringCharArray.
@Test
public void testAuthenticationInfoStringStringCharArray() {
final char[] pwd = new char[6];
final AuthenticationInfo info = new AuthenticationInfo("test", "name", pwd);
Assert.assertEquals("test", info.getAuthType());
Assert.assertEquals("name", info.getUser());
assertSame(pwd, info.getPassword());
}
use of org.apache.sling.auth.core.spi.AuthenticationInfo in project sling by apache.
the class AuthenticationInfoTest method testRemoveObject.
@Test
public void testRemoveObject() {
final AuthenticationInfo info = new AuthenticationInfo("test");
final Object value = "test";
info.put("test", value);
assertSame(value, info.get("test"));
final Object removed = info.remove("test");
assertSame(value, removed);
assertFalse(info.containsKey("test"));
assertNull(info.remove(AuthenticationInfo.AUTH_TYPE));
Assert.assertEquals("test", info.get("sling.authType"));
assertNull(info.remove("sling.authType"));
Assert.assertEquals("test", info.getAuthType());
}
use of org.apache.sling.auth.core.spi.AuthenticationInfo in project sling by apache.
the class AuthenticationInfoTest method testFAIL_AUTH.
@Test
public void testFAIL_AUTH() {
final AuthenticationInfo fa = AuthenticationInfo.FAIL_AUTH;
Assert.assertEquals("FAIL_AUTH", fa.getAuthType());
fa.clear();
Assert.assertEquals("FAIL_AUTH", fa.getAuthType());
fa.put("test", "test");
assertFalse(fa.containsKey("test"));
}
use of org.apache.sling.auth.core.spi.AuthenticationInfo in project sling by apache.
the class AuthenticationInfoTest method testAuthenticationInfoString.
@Test
public void testAuthenticationInfoString() {
final AuthenticationInfo info = new AuthenticationInfo("test");
Assert.assertEquals("test", info.getAuthType());
assertNull(info.getUser());
assertNull(info.getPassword());
}
Aggregations