@Test
public void testUnauthorized() {

    DomainWideDelegationAuthorityProvider provider = new DomainWideDelegationAuthorityProvider();
    try {
        provider.getAccessToken("bob@example.com", SCOPES);
        fail();
    } catch (StatusRuntimeException e) {
        assertEquals(Status.PERMISSION_DENIED.getCode(), e.getStatus().getCode());
    }
}