Send feedback
Class MockTokenServerTransport (2.9.3)
Stay organized with collections
Save and categorize content based on your preferences.
2.9.3 (latest)
2.9.2
2.8.1
2.7.2
2.6.0
2.5.1
2.4.1
2.1.2
2.0.1
1.35.2
1.34.1
1.33.4
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
Inherited Members
com.google.api.client.http.HttpTransport.createRequestFactory()
com.google.api.client.http.HttpTransport.createRequestFactory(com.google.api.client.http.HttpRequestInitializer)
com.google.api.client.http.HttpTransport.isMtls()
com.google.api.client.http.HttpTransport.isShutdown()
com.google.api.client.http.HttpTransport.shutdown()
com.google.api.client.testing.http.MockHttpTransport.buildRequest(java.lang.String,java.lang.String)
com.google.api.client.testing.http.MockHttpTransport.getLowLevelHttpRequest()
com.google.api.client.testing.http.MockHttpTransport.getSupportedMethods()
com.google.api.client.testing.http.MockHttpTransport.supportsMethod(java.lang.String)
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 )
buildRequest(String method, String url)
public LowLevelHttpRequest buildRequest ( String method , String url )
Returns
Type
Description
com.google.api.client.http.LowLevelHttpRequest
Overrides
com.google.api.client.testing.http.MockHttpTransport.buildRequest(java.lang.String,java.lang.String)
Send feedback
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-12-03 UTC."],[],[]]