@Test
public void testAssertionMatchAuthenticatedRoles() {

    Role role = new Role().setName("domain:role.role1");
    ArrayList<Role> roles = new ArrayList<>();
    roles.add(role);
    ArrayList<String> authRoles = new ArrayList<>();
    authRoles.add("domain:role.role1");
    Assertion assertion = new Assertion();
    assertion.setAction("write");
    assertion.setResource("domain:db.write");
    assertion.setRole("domain:role.role1");
    assertTrue(zms.assertionMatch(assertion, "user.john", "write", "domain:db.write", "domain",
            roles, authRoles, null));
    // check case sensitive action and resource
    assertion = new Assertion();
    assertion.setAction("write");
    assertion.setResource("domain:db.write");
    assertion.setRole("domain:role.role1");
    assertTrue(zms.assertionMatch(assertion, "user.john", "write", "domain:db.write", "domain",
            roles, authRoles, null));
    // check case sensitive assertion
    assertion = new Assertion();
    assertion.setAction("WRITE");
    assertion.setResource("domain:db.WRITE");
    assertion.setRole("domain:role.role1");
    assertTrue(zms.assertionMatch(assertion, "user.john", "write", "domain:db.write", "domain",
            roles, authRoles, null));
}