@Test
public void configurationSAUsedWhenConfigured() throws Exception {

  configuration.set(getConfigKey(SERVICE_ACCOUNT_EMAIL_SUFFIX), "foo@example.com");
  configuration.set(getConfigKey(SERVICE_ACCOUNT_PRIVATE_KEY_ID_SUFFIX), "privatekey");
  configuration.set(
      getConfigKey(SERVICE_ACCOUNT_PRIVATE_KEY_SUFFIX),
      Resources.toString(getPath("test-key.txt").toUri().toURL(), UTF_8));
  CredentialFactory credentialFactory = getCredentialFactory();
  GoogleCredentialWithRetry credential =
      (GoogleCredentialWithRetry) credentialFactory.getCredential(TEST_SCOPES);
  assertThat(credential.getServiceAccountId()).isEqualTo("foo@example.com");
  assertThat(credential.getServiceAccountPrivateKeyId()).isEqualTo("privatekey");
}