assertEquals("Mary", result);
}
public void testGetDomain() {
AuthenticationIdentity identity =
new SimpleAuthenticationIdentity("", DmInitialize.DM_PWD_OK1);
String result = IdentityUtil.getDomain(identity);
assertEquals(null, result);
identity =
new SimpleAuthenticationIdentity("Joe@corp", DmInitialize.DM_PWD_OK1);
result = IdentityUtil.getDomain(identity);
assertEquals("corp", result);
identity =
new SimpleAuthenticationIdentity("Mary@entops.example.com",
DmInitialize.DM_PWD_OK1);
result = IdentityUtil.getDomain(identity);
assertEquals("entops", result);
identity =
new SimpleAuthenticationIdentity("Mary@entops.example.com",
DmInitialize.DM_PWD_OK1, "");
result = IdentityUtil.getDomain(identity);
assertEquals("entops", result);
identity =
new SimpleAuthenticationIdentity("Mary@entops.example.com",
DmInitialize.DM_PWD_OK1, "eng");
result = IdentityUtil.getDomain(identity);
assertEquals("eng", result);
}