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

  Assume.assumeNotNull(credentials);
  final GoogleCredentials serviceAccountCredentials;
  final URI keyUri = URI.create("gs://styx-oss-test/styx-test-user.json");
  try (InputStream is = Files.newInputStream(Paths.get(keyUri))) {
    serviceAccountCredentials = GoogleCredentials.fromStream(is)
        .createScoped(ImmutableList.of(
            "https://www.googleapis.com/auth/cloud-platform",
            "https://www.googleapis.com/auth/userinfo.email"));
  }
  serviceAccountCredentials.refresh();
  final GoogleCredentials accessTokenCredentials = GoogleCredentials.newBuilder()
      .setAccessToken(serviceAccountCredentials.getAccessToken())
      .build();
  assertThat(canAcquireIdToken(accessTokenCredentials), is(true));
}