Class MockGoogleCredential (2.6.0)

public class MockGoogleCredential extends GoogleCredential

Beta
Mock for GoogleCredential.

Inheritance

java.lang.Object > com.google.api.client.auth.oauth2.Credential > GoogleCredential > MockGoogleCredential

Static Fields

ACCESS_TOKEN

public static final String ACCESS_TOKEN
Field Value
Type Description
String

REFRESH_TOKEN

public static final String REFRESH_TOKEN
Field Value
Type Description
String

Static Methods

newMockHttpTransportWithSampleTokenResponse()

public static MockHttpTransport newMockHttpTransportWithSampleTokenResponse()

Returns a new MockHttpTransport with a sample MockLowLevelHttpResponse. The response includes sample TokenResponse content as specified in DEFAULT_TOKEN_RESPONSE_JSON. This is meant to produce a minimal implementation that allows methods such as GoogleCredential#executeRefreshToken() to be called without failing abruptly. This content is static. If you are making assertions based on the content of the request, then MockTokenServerTransport should be used instead.

Returns
Type Description
com.google.api.client.testing.http.MockHttpTransport

mockHttpTransport

Constructors

MockGoogleCredential(MockGoogleCredential.Builder builder)

public MockGoogleCredential(MockGoogleCredential.Builder builder)
Parameter
Name Description
builder MockGoogleCredential.Builder