Class MockGoogleCredential (2.9.2)
Stay organized with collections
Save and categorize content based on your preferences.
2.9.2 (latest)
2.9.1
2.8.1
2.7.2
2.6.0
2.5.1
2.4.1
2.1.2
2.0.1
1.35.2
1.34.1
1.33.4
public class MockGoogleCredential extends GoogleCredential
Inherited Members
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 )
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-10-21 UTC.
[null,null,["Last updated 2026-10-21 UTC."],[],[]]