public static class MockGoogleCredential.Builder extends GoogleCredential.Builder
Mock for GoogleCredential.Builder.
Setters that are necessary for simple GoogleCredential creation are overridden in order to change the return type. A concrete JsonFactory is set by default, since JSON parsing is relied upon often in GoogleCredential which makes mocking parse calls problematic.
By default, a standard MockHttpTransport is supplied. For simple tests in which 'refresh' methods are called but the request/response isn't used #newMockHttpTransportWithSampleTokenResponse() provides a minimal implementation. For more complex tests which check request/response behavior prefer MockTokenServerTransport.
Inheritance
java.lang.Object > com.google.api.client.auth.oauth2.Credential.Builder > GoogleCredential.Builder > MockGoogleCredential.BuilderConstructors
Builder()
public Builder()
Methods
build()
public MockGoogleCredential build()
Type | Description |
MockGoogleCredential |
setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
public MockGoogleCredential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
Name | Description |
clientAuthentication | com.google.api.client.http.HttpExecuteInterceptor |
Type | Description |
MockGoogleCredential.Builder |
setClock(Clock clock)
public MockGoogleCredential.Builder setClock(Clock clock)
Name | Description |
clock | com.google.api.client.util.Clock |
Type | Description |
MockGoogleCredential.Builder |
setJsonFactory(JsonFactory jsonFactory)
public MockGoogleCredential.Builder setJsonFactory(JsonFactory jsonFactory)
Name | Description |
jsonFactory | com.google.api.client.json.JsonFactory |
Type | Description |
MockGoogleCredential.Builder |
setTransport(HttpTransport transport)
public MockGoogleCredential.Builder setTransport(HttpTransport transport)
Name | Description |
transport | com.google.api.client.http.HttpTransport |
Type | Description |
MockGoogleCredential.Builder |