@Test
public void metadataServiceIsUsedByDefault() throws Exception {

  TokenResponse token = new TokenResponse().setAccessToken("metadata-test-token");
  MockHttpTransport transport = mockTransport(jsonDataResponse(token));
  CredentialFactory.setStaticHttpTransport(transport);
  CredentialFactory credentialFactory = getCredentialFactory();
  Credential credential = credentialFactory.getCredential(TEST_SCOPES);
  assertThat(credential.getAccessToken()).isEqualTo("metadata-test-token");
}