@Beta public class MockGoogleCredential extends GoogleCredential
Modifier and Type | Class and Description |
---|---|
static class |
MockGoogleCredential.Builder
Mock for GoogleCredential.Builder.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_TOKEN |
static String |
REFRESH_TOKEN |
Constructor and Description |
---|
MockGoogleCredential(MockGoogleCredential.Builder builder) |
Modifier and Type | Method and Description |
---|---|
static com.google.api.client.testing.http.MockHttpTransport |
newMockHttpTransportWithSampleTokenResponse()
Returns a new
MockHttpTransport with a sample MockLowLevelHttpResponse . |
createDelegated, createScoped, createScopedRequired, executeRefreshToken, fromStream, fromStream, getApplicationDefault, getApplicationDefault, getServiceAccountId, getServiceAccountPrivateKey, getServiceAccountPrivateKeyId, getServiceAccountProjectId, getServiceAccountScopes, getServiceAccountScopesAsString, getServiceAccountUser, setAccessToken, setExpirationTimeMilliseconds, setExpiresInSeconds, setFromTokenResponse, setRefreshToken, toBuilder
getAccessToken, getClientAuthentication, getClock, getExpirationTimeMilliseconds, getExpiresInSeconds, getJsonFactory, getMethod, getRefreshListeners, getRefreshToken, getRequestInitializer, getTokenServerEncodedUrl, getTransport, handleResponse, initialize, intercept, refreshToken
public static final String ACCESS_TOKEN
public static final String REFRESH_TOKEN
public MockGoogleCredential(MockGoogleCredential.Builder builder)
public static com.google.api.client.testing.http.MockHttpTransport newMockHttpTransportWithSampleTokenResponse()
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.Copyright © 2010–2019 Google. All rights reserved.