ZMSAuthorizer implements Authorizer, Closeable { boolean isRoleToken(String token) { boolean roleToken = false; for (String item : token.split(";")) { if ("v=Z1".equalsIgnoreCase(item)) { roleToken = true; break; } } return roleToken; } ZMSAuthorizer(String serviceDomain);  ZMSAuthorizer(String endpoint, String serviceDomain); void close(); void setZMSClient(ZMSClient client); boolean access(String action, String resource, String token, String trustDomain); boolean access(String action, String resource, Principal principal, String trustDomain);  }
@Test public void testIsRoleToken() { String domain = "AuthorizerRoleToken"; ZMSAuthorizer authorizer = new ZMSAuthorizer(zmsUrl, domain); assertTrue(authorizer.isRoleToken("v=Z1;d=domain;r=roles;s=signature")); assertTrue(authorizer.isRoleToken("d=domain;r=roles;v=Z1;s=signature")); assertFalse(authorizer.isRoleToken("v=S1;d=domain;n=server;s=signature")); assertFalse(authorizer.isRoleToken("d=domain;r=roles;s=signature")); assertFalse(authorizer.isRoleToken("vZ1")); authorizer.close(); }