Package com.google.api.client.googleapis.testing.auth.oauth2 (2.5.1)

com.google.api.client.util.Beta
Test utilities for the com.google.api.client.googleapis.auth.oauth2 package.

Classes

MockGoogleCredential

Beta
Mock for GoogleCredential.

MockGoogleCredential.Builder

Mock for GoogleCredential.Builder.

Setters that are necessary for simple GoogleCredential creation are overridden in order to change the return type. A concrete JsonFactory is set by default, since JSON parsing is relied upon often in GoogleCredential which makes mocking parse calls problematic.

By default, a standard MockHttpTransport is supplied. For simple tests in which 'refresh' methods are called but the request/response isn't used #newMockHttpTransportWithSampleTokenResponse() provides a minimal implementation. For more complex tests which check request/response behavior prefer MockTokenServerTransport.

MockTokenServerTransport

Beta
A test transport that simulates Google's token server for refresh tokens and service accounts.