* @see BasicHive#getPrincipals(org.wicketstuff.security.hive.authorization.Permission)
*/
public void testGetPrincipals()
{
BasicHive hive = new BasicHive();
hive.addPermission(new EverybodyPrincipal(), new TestPermission("foobar"));
hive.addPermission(new SimplePrincipal("foo.bar"), new TestPermission("foobar"));
hive.addPermission(new EverybodyPrincipal(), new TestPermission("test", "read, write"));
assertEquals(Collections.EMPTY_SET, hive.getPrincipals(new TestPermission("foo")));
Set<Principal> principals = hive.getPrincipals(new TestPermission("foobar"));
assertEquals(2, principals.size());
assertTrue(principals.contains(new EverybodyPrincipal()));
assertTrue(principals.contains(new SimplePrincipal("foo.bar")));
principals = hive.getPrincipals(new TestPermission("test", "read, write"));
assertEquals(1, principals.size());
assertTrue(principals.contains(new EverybodyPrincipal()));
}