use of org.apache.cxf.interceptor.security.test.GroupWrapper in project cxf by apache.
the class DeprecatedSecurityContextTest method testPrivateStaticGroup.
@Test
public void testPrivateStaticGroup() {
Subject s = new Subject();
Principal p = new SimplePrincipal("Barry");
s.getPrincipals().add(p);
// create a friend group and add Barry to this group
GroupWrapper test = new GroupWrapper("friend", "Barry");
s.getPrincipals().add(test.getGroup());
LoginSecurityContext context = new DefaultSecurityContext(p, s);
assertTrue(context.isUserInRole("Barry"));
}
Aggregations