@Test
public void testGetAWSTemporaryCredentialsAuthorizedPrincipal() {

    SimplePrincipal principal = (SimplePrincipal) SimplePrincipal.create("user_domain",
            "user101", "v=U1;d=user_domain;n=user101;s=signature", 0, null);
    principal.setAuthorizedService("athenz.service");
    MockCloudStore cloudStore = new MockCloudStore();
    cloudStore.setMockFields("1234", "aws_role_name", "user_domain.user101");
    store.setCloudStore(cloudStore);
    zts.cloudStore = cloudStore;
    SignedDomain signedDomain = createAwsSignedDomain("athenz.product", "1234");
    store.processDomain(signedDomain, false);
    try {
        zts.getAWSTemporaryCredentials(createResourceContext(principal), "athenz.product",
                "aws_role_name", null, null);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 403);
        assertTrue(ex.getMessage().contains("Authorized Service Principals not allowed"));
    }
}