Skip to content

Possible Regression in MockTokenServerTransport #1151

Closed
@hiranya911

Description

@hiranya911

Following test case used to work in google-api-client 1.23.0, but breaks in 1.25.0:

@Test
  public void testMe() throws IOException {
    final MockTokenServerTransport transport = new MockTokenServerTransport();
    transport.addServiceAccount(ServiceAccount.EDITOR.getEmail(), ACCESS_TOKEN);
    ServiceAccountCredentials creds = ServiceAccountCredentials.fromStream(ServiceAccount.EDITOR.asStream(),
        new HttpTransportFactory() {
          @Override
          public HttpTransport create() {
            return transport;
          }
        });
    GoogleCredentials scoped = creds.createScoped(
        ImmutableList.of("https://www.googleapis.com/auth/cloud-platform"));
    assertNotNull(scoped.refreshAccessToken());
  }

In the latest version I must pass in the URL "https://accounts.google.com/o/oauth2/token" to the MockTokenServerTransport. Is this intentional or a regression?

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions