@Test public void testResolveAttemptToGetInstanceId() { final String resultId = "i-5325f23"; String result = ConfigParameter.resolveCloudInstanceId(new UtilityHttpClient() { @Override public String performGetRequest(String url) throws Exception { return resultId; } }); assertTrue(result.equals(resultId)); }
public static String resolveCloudInstanceId(UtilityHttpClient httpClient) { if (cachedCloudInstanceId == null) { String value = null; LOGGER.debug("Attempting to get AWS instanceId information"); try { String response = httpClient .performGetRequest("http: if (response != null) { value = response; LOGGER.debug(format("Found AWS instanceId: %s", value)); } } catch (Exception e) { } cachedCloudInstanceId = value; } return cachedCloudInstanceId; }
ConfigParameter { public static String resolveCloudInstanceId(UtilityHttpClient httpClient) { if (cachedCloudInstanceId == null) { String value = null; LOGGER.debug("Attempting to get AWS instanceId information"); try { String response = httpClient .performGetRequest("http: if (response != null) { value = response; LOGGER.debug(format("Found AWS instanceId: %s", value)); } } catch (Exception e) { } cachedCloudInstanceId = value; } return cachedCloudInstanceId; } }
ConfigParameter { public static String resolveCloudInstanceId(UtilityHttpClient httpClient) { if (cachedCloudInstanceId == null) { String value = null; LOGGER.debug("Attempting to get AWS instanceId information"); try { String response = httpClient .performGetRequest("http: if (response != null) { value = response; LOGGER.debug(format("Found AWS instanceId: %s", value)); } } catch (Exception e) { } cachedCloudInstanceId = value; } return cachedCloudInstanceId; }  }
ConfigParameter { public static String resolveCloudInstanceId(UtilityHttpClient httpClient) { if (cachedCloudInstanceId == null) { String value = null; LOGGER.debug("Attempting to get AWS instanceId information"); try { String response = httpClient .performGetRequest("http: if (response != null) { value = response; LOGGER.debug(format("Found AWS instanceId: %s", value)); } } catch (Exception e) { } cachedCloudInstanceId = value; } return cachedCloudInstanceId; }  static String resolveAndReplace(char[] chars, int offset, int length, Map<String, String> parameterValuePairs,
            Properties configuration, List<String> errors); static String resolveCloudHost(UtilityHttpClient httpClient); static String resolveHostname(); static String resolveCloudInstanceId(UtilityHttpClient httpClient); }
ConfigParameter { public static String resolveCloudInstanceId(UtilityHttpClient httpClient) { if (cachedCloudInstanceId == null) { String value = null; LOGGER.debug("Attempting to get AWS instanceId information"); try { String response = httpClient .performGetRequest("http: if (response != null) { value = response; LOGGER.debug(format("Found AWS instanceId: %s", value)); } } catch (Exception e) { } cachedCloudInstanceId = value; } return cachedCloudInstanceId; }  static String resolveAndReplace(char[] chars, int offset, int length, Map<String, String> parameterValuePairs,
            Properties configuration, List<String> errors); static String resolveCloudHost(UtilityHttpClient httpClient); static String resolveHostname(); static String resolveCloudInstanceId(UtilityHttpClient httpClient); static String cachedCloudHost; static String cachedCloudInstanceId; }