Search in sources :

Example 1 with RelationshipManager

use of org.picketlink.idm.RelationshipManager in project wildfly by wildfly.

the class AbstractBasicIdentityManagementTestCase method testRelationshipManagement.

@Test
@InSequence(5)
public void testRelationshipManagement() throws Exception {
    PartitionManager partitionManager = getPartitionManager();
    IdentityManager identityManager = partitionManager.createIdentityManager();
    User user = getUser(identityManager, "johny");
    Role role = getRole(identityManager, "admin");
    RelationshipManager relationshipManager = partitionManager.createRelationshipManager();
    BasicModel.grantRole(relationshipManager, user, role);
    assertTrue(hasRole(relationshipManager, user, role));
}
Also used : BasicModel.hasRole(org.picketlink.idm.model.basic.BasicModel.hasRole) Role(org.picketlink.idm.model.basic.Role) BasicModel.getRole(org.picketlink.idm.model.basic.BasicModel.getRole) IdentityManager(org.picketlink.idm.IdentityManager) User(org.picketlink.idm.model.basic.User) BasicModel.getUser(org.picketlink.idm.model.basic.BasicModel.getUser) PartitionManager(org.picketlink.idm.PartitionManager) RelationshipManager(org.picketlink.idm.RelationshipManager) Test(org.junit.Test) InSequence(org.jboss.arquillian.junit.InSequence)

Aggregations

InSequence (org.jboss.arquillian.junit.InSequence)1 Test (org.junit.Test)1 IdentityManager (org.picketlink.idm.IdentityManager)1 PartitionManager (org.picketlink.idm.PartitionManager)1 RelationshipManager (org.picketlink.idm.RelationshipManager)1 BasicModel.getRole (org.picketlink.idm.model.basic.BasicModel.getRole)1 BasicModel.getUser (org.picketlink.idm.model.basic.BasicModel.getUser)1 BasicModel.hasRole (org.picketlink.idm.model.basic.BasicModel.hasRole)1 Role (org.picketlink.idm.model.basic.Role)1 User (org.picketlink.idm.model.basic.User)1