Class MockGoogleCredential (1.35.2)

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
TypeDescription
String

REFRESH_TOKEN

public static final String REFRESH_TOKEN
Field Value
TypeDescription
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
TypeDescription
com.google.api.client.testing.http.MockHttpTransport

mockHttpTransport

Constructors

MockGoogleCredential(MockGoogleCredential.Builder builder)

public MockGoogleCredential(MockGoogleCredential.Builder builder)
Parameter
NameDescription
builderMockGoogleCredential.Builder