Class MockMetadataServerTransport (2.6.0)
2.9.1 (latest)
2.9.0
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 MockMetadataServerTransport extends MockHttpTransport
Beta
Transport that simulates the GCE metadata server for access tokens.
Inheritance
java.lang.Object >
com.google.api.client.http.HttpTransport >
com.google.api.client.testing.http.MockHttpTransport >
MockMetadataServerTransport
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
public MockMetadataServerTransport ( String accessToken )
Parameter
Name
Description
accessToken
String
Methods
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)
public void setTokenRequestStatusCode ( Integer tokenRequestStatusCode )
Parameter
Name
Description
tokenRequestStatusCode
Integer
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-02 UTC."],[],[]]