// Create a mock session
Contexts.getSessionContext().set(Component.getComponentName(Session.class), new Session());
Identity identity = new MockIdentity();
identity.create();
// Put the identity into our session context
Contexts.getSessionContext().set(Component.getComponentName(Identity.class), identity);
// Test addRole()