@Test
public void testImpersonatedCredentials() throws IOException, GeneralSecurityException {

  Assume.assumeNotNull(credentials);
  final ImpersonatedCredentials impersonatedCredentials = ImpersonatedCredentials.newBuilder()
      .setScopes(ImmutableList.of("https://www.googleapis.com/auth/cloud-platform"))
      .setSourceCredentials(credentials)
      .setTargetPrincipal("styx-test-user@styx-oss-test.iam.gserviceaccount.com")
      .setLifetime(300)
      .setDelegates(ImmutableList.of())
      .build();
  assertThat(canAcquireIdToken(impersonatedCredentials), is(true));
}