private bool IsHealthy()
{
var healthUri = $"{configurationProvider.TestUri}/health";
loggerProvider.GetLogger().Debug(@"Using health URI: " + healthUri);
var client = new HttpClient();
var response = client.GetAsync(healthUri).Result;
var isOk = response.StatusCode == HttpStatusCode.OK;
loggerProvider.GetLogger().Debug($"Status code received: {response.StatusCode}");
if (!isOk)
{
loggerProvider.GetLogger().Debug(response.PrintCorrelationIdToConsole());
}
var healthResult = response.Content.ReadAsAsync<HealthResult>().Result;
loggerProvider.GetLogger().Debug("HealthResult received: {@healthResult}", healthResult);
var isHealthy = healthResult.IsHealthy;
return isOk && isHealthy;
}