@Test public void getWhenMetadataPresent() throws Exception { server.enqueue(new MockResponse().setBody("ec2-50-17-85-234.compute-1.amazonaws.com")); assertThat( InstanceMetadataHook .get(server.getUrl(InstanceMetadataHook.DEFAULT_URI.getPath()).toURI(), "public-hostname")).isEqualTo( "ec2-50-17-85-234.compute-1.amazonaws.com"); assertThat(server.takeRequest()) .hasMethod("GET") .hasPath("/latest/meta-data/public-hostname"); }
public static String get(String path) { return get(DEFAULT_URI, path); }
InstanceMetadataHook { public static String get(String path) { return get(DEFAULT_URI, path); } }
InstanceMetadataHook { public static String get(String path) { return get(DEFAULT_URI, path); }  }
InstanceMetadataHook { public static String get(String path) { return get(DEFAULT_URI, path); }  static List<String> list(String path); static List<String> list(URI metadataService, String path); static String get(String path); static String get(URI metadataService, String path); }
InstanceMetadataHook { public static String get(String path) { return get(DEFAULT_URI, path); }  static List<String> list(String path); static List<String> list(URI metadataService, String path); static String get(String path); static String get(URI metadataService, String path); static final URI DEFAULT_URI; }