@Test
public void testGetRoleTokenSpecifiedRoleValid() {

    
    SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", true);
    store.processDomain(signedDomain, false);
    
    Principal principal = SimplePrincipal.create("user_domain", "user",
            "v=U1;d=user_domain;n=user;s=signature", 0, null);
    ResourceContext context = createResourceContext(principal);
    
    RoleToken roleToken = zts.getRoleToken(context, "coretech", "writers", 600,
            1200, null);
    com.yahoo.athenz.auth.token.RoleToken token = new com.yahoo.athenz.auth.token.RoleToken(roleToken.getToken());
    assertEquals(token.getRoles().size(), 1);
    assertTrue(token.getRoles().contains("writers"));
    
    Principal principal1 = SimplePrincipal.create("user_domain", "user1",
            "v=U1;d=user_domain;n=user1;s=signature", 0, null);
    ResourceContext context1 = createResourceContext(principal1);
    
    roleToken = zts.getRoleToken(context1, "coretech", "writers", null, 1200, null);
    token = new com.yahoo.athenz.auth.token.RoleToken(roleToken.getToken());
    assertEquals(token.getRoles().size(), 1);
    assertTrue(token.getRoles().contains("writers"));
    
    Principal principal4 = SimplePrincipal.create("user_domain", "user4",
            "v=U1;d=user_domain;n=user4;s=signature", 0, null);
    ResourceContext context4 = createResourceContext(principal4);
    
    roleToken = zts.getRoleToken(context4, "coretech", "readers", 600, null, null);
    token = new com.yahoo.athenz.auth.token.RoleToken(roleToken.getToken());
    assertEquals(token.getRoles().size(), 1);
    assertTrue(token.getRoles().contains("readers"));
    assertFalse(token.getRoles().contains(";c=1;"));
}