@Test
public void testUnauthorized() {

    RefreshTokenProvider provider = new RefreshTokenProvider();
    try {
        provider.getAccessToken("bob@example.com", SCOPES);
        fail("StatusRuntimeException not thrown");
    } catch (StatusRuntimeException e) {
        assertEquals(Status.PERMISSION_DENIED.getCode(), e.getStatus().getCode());
        assertEquals(
            "GCP Token Broker authorization is invalid or has expired for identity: bob@example.com",
            e.getStatus().getDescription());
    }
}