Class MockGoogleClientRequest<T> (2.5.1)

public class MockGoogleClientRequest<T> extends AbstractGoogleClientRequest<T>

Beta
Thread-safe mock Google request.

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > AbstractGoogleClientRequest > MockGoogleClientRequest<T>

Type Parameter

Name Description
T

Constructors

MockGoogleClientRequest(AbstractGoogleClient client, String method, String uriTemplate, HttpContent content, Class<T> responseClass)

public MockGoogleClientRequest(AbstractGoogleClient client, String method, String uriTemplate, HttpContent content, Class<T> responseClass)
Parameters
Name Description
client AbstractGoogleClient

Google client

method String

HTTP Method

uriTemplate String

URI template for the path relative to the base URL. If it starts with a "/" the base path from the base URL will be stripped out. The URI template can also be a full URL. URI template expansion is done using UriTemplate#expand(String, String, Object, boolean)

content com.google.api.client.http.HttpContent

HTTP content or null for none

responseClass Class<T>

response class to parse into

MockGoogleClientRequest(AbstractGoogleClient client, String method, String uriTemplate, HttpContent content, Class<T> responseClass, String apiVersion)

public MockGoogleClientRequest(AbstractGoogleClient client, String method, String uriTemplate, HttpContent content, Class<T> responseClass, String apiVersion)
Parameters
Name Description
client AbstractGoogleClient

Google client

method String

HTTP Method

uriTemplate String

URI template for the path relative to the base URL. If it starts with a "/" the base path from the base URL will be stripped out. The URI template can also be a full URL. URI template expansion is done using UriTemplate#expand(String, String, Object, boolean)

content com.google.api.client.http.HttpContent

HTTP content or null for none

responseClass Class<T>

response class to parse into

apiVersion String

ApiVersion to be passed to the header

Methods

set(String fieldName, Object value)

public MockGoogleClientRequest<T> set(String fieldName, Object value)
Parameters
Name Description
fieldName String
value Object
Returns
Type Description
MockGoogleClientRequest<T>
Overrides

setDisableGZipContent(boolean disableGZipContent)

public MockGoogleClientRequest<T> setDisableGZipContent(boolean disableGZipContent)

Sets whether to disable GZip compression of HTTP content.

By default it is false.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
Name Description
disableGZipContent boolean
Returns
Type Description
MockGoogleClientRequest<T>
Overrides

setRequestHeaders(HttpHeaders headers)

public MockGoogleClientRequest<T> setRequestHeaders(HttpHeaders headers)

Sets the HTTP headers used for the Google client request.

These headers are set on the request after #buildHttpRequest is called, this means that HttpRequestInitializer#initialize is called first.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
Name Description
headers com.google.api.client.http.HttpHeaders
Returns
Type Description
MockGoogleClientRequest<T>
Overrides