Class MockTokenServerTransport (2.0.0)

public class MockTokenServerTransport extends MockHttpTransport

Beta
A test transport that simulates Google's token server for refresh tokens and service accounts.

Inheritance

java.lang.Object > com.google.api.client.http.HttpTransport > com.google.api.client.testing.http.MockHttpTransport > MockTokenServerTransport

Constructors

MockTokenServerTransport()

public MockTokenServerTransport()

MockTokenServerTransport(String tokenServerUrl)

public MockTokenServerTransport(String tokenServerUrl)
Parameter
NameDescription
tokenServerUrlString

Methods

addClient(String clientId, String clientSecret)

public void addClient(String clientId, String clientSecret)
Parameters
NameDescription
clientIdString
clientSecretString

addRefreshToken(String refreshToken, String accessTokenToReturn)

public void addRefreshToken(String refreshToken, String accessTokenToReturn)
Parameters
NameDescription
refreshTokenString
accessTokenToReturnString

addServiceAccount(String email, String accessToken)

public void addServiceAccount(String email, String accessToken)
Parameters
NameDescription
emailString
accessTokenString

buildRequest(String method, String url)

public LowLevelHttpRequest buildRequest(String method, String url)
Parameters
NameDescription
methodString
urlString
Returns
TypeDescription
com.google.api.client.http.LowLevelHttpRequest
Overrides
com.google.api.client.testing.http.MockHttpTransport.buildRequest(java.lang.String,java.lang.String)
Exceptions
TypeDescription
IOException