@Test
public void testGetRoleTokenLeastPrivilegedEnabled() {

    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);
    zts.leastPrivilegePrincipal = true;
    try {
        zts.getRoleToken(context, "coretech", null, 600, 1200, null);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
        assertTrue(ex.getMessage().contains("must specify a roleName"));
    }
}