Class MockGoogleCredential (2.7.2)

public class MockGoogleCredential extends GoogleCredential

Beta
Mock for GoogleCredential.

Inheritance

java.lang.Object > com.google.api.client.auth.oauth2.Credential > GoogleCredential > MockGoogleCredential
com.google.api.client.auth.oauth2.Credential.getAccessToken()
com.google.api.client.auth.oauth2.Credential.getClientAuthentication()
com.google.api.client.auth.oauth2.Credential.getClock()
com.google.api.client.auth.oauth2.Credential.getExpirationTimeMilliseconds()
com.google.api.client.auth.oauth2.Credential.getExpiresInSeconds()
com.google.api.client.auth.oauth2.Credential.getJsonFactory()
com.google.api.client.auth.oauth2.Credential.getMethod()
com.google.api.client.auth.oauth2.Credential.getRefreshListeners()
com.google.api.client.auth.oauth2.Credential.getRefreshToken()
com.google.api.client.auth.oauth2.Credential.getRequestInitializer()
com.google.api.client.auth.oauth2.Credential.getTokenServerEncodedUrl()
com.google.api.client.auth.oauth2.Credential.getTransport()
com.google.api.client.auth.oauth2.Credential.handleResponse(com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse,boolean)
com.google.api.client.auth.oauth2.Credential.initialize(com.google.api.client.http.HttpRequest)
com.google.api.client.auth.oauth2.Credential.intercept(com.google.api.client.http.HttpRequest)
com.google.api.client.auth.oauth2.Credential.refreshToken()

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