user.setExtension("4444"); List aliases = user.getAliases(DOMAIN); assertEquals(1, aliases.size()); AliasMapping alias = (AliasMapping) aliases.get(0); assertEquals("4444@sipfoundry.org", alias.getIdentity()); assertEquals("sip:" + USERNAME + "@" + DOMAIN, alias.getContact());
Set aliases = new LinkedHashSet(); aliases.add(ALIAS1); aliases.add(ALIAS2); user.setAliases(aliases); assertEquals(ALIASES_STRING, user.getAliasesString()); checkAliases(user);  user.setAliases(new LinkedHashSet()); user.setAliasesString(ALIASES_STRING); checkAliases(user);  List aliasMappings = user.getAliasMappings(DOMAIN); assertEquals(2, aliasMappings.size()); AliasMapping alias = (AliasMapping) aliasMappings.get(0); assertEquals(ALIAS1 + "@" + DOMAIN, alias.getIdentity()); final String CONTACT = "sip:" + USERNAME + "@" + DOMAIN; assertEquals(CONTACT, alias.getContact()); alias = (AliasMapping) aliasMappings.get(1); assertEquals(ALIAS2 + "@" + DOMAIN, alias.getIdentity()); assertEquals(CONTACT, alias.getContact());
    public void testGetAliases() {        User user = new User();        user.setUserName(USERNAME);        user.setExtension("4444");        List aliases = user.getAliases(DOMAIN);        assertEquals(1, aliases.size());        AliasMapping alias = (AliasMapping) aliases.get(0);        assertEquals("4444@sipfoundry.org", alias.getIdentity());        assertEquals("sip:" + USERNAME + "@" + DOMAIN, alias.getContact());    }