assertEquals(2, countUrlsForIdentityConnectorPair(ap, id, "ex-tca-02"));
}
public void testMatchesIdentity() {
AuthenticationIdentity nameId =
new SimpleAuthenticationIdentity("user1");
assertTrue(AuthorizationParser.matchesIdentity(nameId,
"user1", null, null));
assertTrue(AuthorizationParser.matchesIdentity(nameId,
"user1", "", null));
assertTrue(AuthorizationParser.matchesIdentity(nameId,
"user1", null, ""));
assertTrue(AuthorizationParser.matchesIdentity(nameId,
"user1", "", ""));
assertFalse(AuthorizationParser.matchesIdentity(nameId,
"user2", null, null));
assertFalse(AuthorizationParser.matchesIdentity(nameId,
"user1", "pass1", null));
assertFalse(AuthorizationParser.matchesIdentity(nameId,
"user1", null, "domain1"));
AuthenticationIdentity namePassId =
new SimpleAuthenticationIdentity("user1", "pass1");
assertTrue(AuthorizationParser.matchesIdentity(namePassId,
"user1", "pass1", null));
assertTrue(AuthorizationParser.matchesIdentity(namePassId,
"user1", "pass1", ""));
assertFalse(AuthorizationParser.matchesIdentity(namePassId,
"user2", "pass1", null));
assertFalse(AuthorizationParser.matchesIdentity(namePassId,
"user1", "pass2", null));
assertFalse(AuthorizationParser.matchesIdentity(namePassId,
"user1", "", null));
AuthenticationIdentity namePassDomainId =
new SimpleAuthenticationIdentity("user1", "pass1", "domain1");
assertTrue(AuthorizationParser.matchesIdentity(namePassDomainId,
"user1", "pass1", "domain1"));
assertFalse(AuthorizationParser.matchesIdentity(namePassDomainId,
"user1", "pass1", "domain2"));
assertFalse(AuthorizationParser.matchesIdentity(namePassDomainId,
"user1", "pass2", "domain1"));
assertFalse(AuthorizationParser.matchesIdentity(namePassDomainId,
"user2", "pass1", "domain1"));
AuthenticationIdentity nameDomainId =
new SimpleAuthenticationIdentity("user1", null, "domain1");
assertTrue(AuthorizationParser.matchesIdentity(nameDomainId,
"user1", "", "domain1"));
assertTrue(AuthorizationParser.matchesIdentity(nameDomainId,
"user1", null, "domain1"));
assertFalse(AuthorizationParser.matchesIdentity(nameDomainId,