assertTrue(group.isMember(user, DomainRegistry.groupMemberService()));
assertTrue(managerRole.isInRole(user, DomainRegistry.groupMemberService()));
}
public void testUserIsNotInRole() throws Exception {
Tenant tenant = this.tenantAggregate();
User user = this.userAggregate();
DomainRegistry.userRepository().add(user);
Role managerRole = tenant.provisionRole("Manager", "A manager role.", true);
Group group = tenant.provisionGroup("Managers", "A group of managers.");
DomainRegistry.groupRepository().add(group);
managerRole.assignGroup(group, DomainRegistry.groupMemberService());
DomainRegistry.roleRepository().add(managerRole);
Role accountantRole = new Role(user.tenantId(), "Accountant", "An accountant role.");
DomainRegistry.roleRepository().add(accountantRole);