@VisibleForTesting
  @Override
  public String getFailureDomain() {
    final String responsePayload = getAzureInstanceMetadata();

    // For a sample response payload,
    // check https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service?tabs=linux
    try {
      final JsonNode jsonNode = JsonUtils.stringToJsonNode(responsePayload);
      final JsonNode computeNode = jsonNode.path(COMPUTE);

      if (computeNode.isMissingNode()) {
        throw new RuntimeException(
            "[AzureEnvironmentProvider]: Compute node is missing in the payload. Cannot retrieve failure domain "
                + "information");
      }
      final JsonNode platformFailureDomainNode = computeNode.path(PLATFORM_FAULT_DOMAIN);
      if (platformFailureDomainNode.isMissingNode() || !platformFailureDomainNode.isTextual()) {
        throw new RuntimeException("[AzureEnvironmentProvider]: Json node platformFaultDomain is missing or is invalid."
            + " No failure domain information retrieved for given server instance");
      }
      return platformFailureDomainNode.textValue();
    } catch (IOException ex) {
      throw new RuntimeException(String.format(
          "[AzureEnvironmentProvider]: Errors when parsing response payload from Azure Instance Metadata Service: %s",
          responsePayload), ex);
    }
  }
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp =
      "\\[AzureEnvironmentProvider\\]: Failed to retrieve azure instance metadata. Response Status code: "
          + SC_NOT_FOUND)
  public void testIMDSCallFailure()
      throws IOException {
    mockUtil();
    when(_mockHttpResponse.getCode()).thenReturn(SC_NOT_FOUND);
    _azureEnvironmentProviderWithParams.getFailureDomain();
  }