@Test
public void testIsMemberOfRole() {

    List<RoleMember> roleMembers = new ArrayList<>();
    // valid members
    RoleMember roleMemberJoe = new RoleMember()
            .setMemberName("user.joe")
            .setPrincipalType(Principal.Type.USER.getValue());
    RoleMember roleMemberJane = new RoleMember()
            .setMemberName("user.jane")
            .setPrincipalType(Principal.Type.USER.getValue());
    RoleMember roleGroup1  = new RoleMember()
            .setMemberName("coretech:group.dev-team")
            .setPrincipalType(Principal.Type.GROUP.getValue());
    roleMembers.add(roleMemberJoe);
    roleMembers.add(roleMemberJane);
    roleMembers.add(roleGroup1);
    Role role = new Role().setName("coretech:role.role1").setRoleMembers(roleMembers);
    // carry out the checks
    assertTrue(AuthzHelper.isMemberOfRole(role, "user.joe", devTeamFetcher));
    assertTrue(AuthzHelper.isMemberOfRole(role, "user.jane", devTeamFetcher));
    assertFalse(AuthzHelper.isMemberOfRole(role, "user.john", devTeamFetcher));
    assertTrue(AuthzHelper.isMemberOfRole(role, "user.valid", devTeamFetcher));
    assertFalse(AuthzHelper.isMemberOfRole(role, "user.disabled", devTeamFetcher));
    assertFalse(AuthzHelper.isMemberOfRole(role, "user.expired", devTeamFetcher));
    assertFalse(AuthzHelper.isMemberOfRole(role, "user.unknown", devTeamFetcher));
}