Class MockTokenServerTransport (2.5.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
Name Description
tokenServerUrl String

Methods

addClient(String clientId, String clientSecret)

public void addClient(String clientId, String clientSecret)
Parameters
Name Description
clientId String
clientSecret String

addRefreshToken(String refreshToken, String accessTokenToReturn)

public void addRefreshToken(String refreshToken, String accessTokenToReturn)
Parameters
Name Description
refreshToken String
accessTokenToReturn String

addServiceAccount(String email, String accessToken)

public void addServiceAccount(String email, String accessToken)
Parameters
Name Description
email String
accessToken String

buildRequest(String method, String url)

public LowLevelHttpRequest buildRequest(String method, String url)
Parameters
Name Description
method String
url String
Returns
Type Description
com.google.api.client.http.LowLevelHttpRequest
Overrides
com.google.api.client.testing.http.MockHttpTransport.buildRequest(java.lang.String,java.lang.String)
Exceptions
Type Description
IOException