Map<String,Object> cmap = new HashMap<String,Object>();
cmap.put(ResourceKeys.ROLEREF_PERM_CHECK, true);
cmap.put(ResourceKeys.ROLENAME, "employee");
EJBResource resource = new EJBResource(cmap);
resource.setPrincipal(new SimplePrincipal("AuthenticatedPrincipal"));
resource.setEjbMethod(DummyClass.class.getDeclaredMethods()[0]);
resource.setEjbName(DummyClass.class.getCanonicalName());
resource.setEjbMethodRoles( getRoleGroup(new String[] {"gooduser"}) );
resource.setEnforceEJBRestrictions(true); //Enforce EJB 1.1
Set<SecurityRoleRef> roleRefSet = new HashSet<SecurityRoleRef>();
roleRefSet.add(new SecurityRoleRef("employee", "gooduser"));
resource.setSecurityRoleReferences(roleRefSet);
int result = epmd.authorize(resource,
new Subject(),
getRoleGroup(new String[]{"gooduser", "validuser" }));
assertEquals(AuthorizationContext.PERMIT, result);