InstanceMetadata { public InstanceMetadata(JsonFactory jsonFactory, HttpTransport httpTransport) { this.jsonParser = new JsonObjectParser(jsonFactory); this.requestFactory = httpTransport.createRequestFactory(); } InstanceMetadata(JsonFactory jsonFactory, HttpTransport httpTransport); String metadata(String keyName); static String resourceShortName(String resource); String customMetadata(String keyName); OAuth2ServiceTokenMetadata serviceToken(final String scope); OAuth2ServiceTokenMetadata serviceToken(final String serviceAccount, final String scope); NetworkMetadata network();  }
@Test public void testInstanceMetadata() { InstanceMetadata metadata = mockOkayRequest("there"); assertEquals("there", metadata.metadata("hostname")); assertEquals("there", metadata.customMetadata("hostname")); assertNotNull(metadata.toString()); }