Skip to content

Commit

Permalink
[Tools] [DependencyTester] Fixed CheckRestService method
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromonaco committed Feb 23, 2022
1 parent ba28085 commit e870662
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Tools/src/DependencyTester/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,24 @@ internal static void CheckRestService(string restUrl, string restVerb, string re
httpClient.DefaultRequestHeaders.Accept
.Add(new MediaTypeWithQualityHeaderValue("application/json")); //ACCEPT header

if (restVerb.Equals("GET"))
{
result = httpClient.GetAsync(restUrl).Result;
}

if (result != null && result.StatusCode.Equals(HttpStatusCode.OK))
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"REST Service: {restUrl} OK");
Console.WriteLine($"REST Response: {result.Content.ReadAsStringAsync().Result}");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"REST Service: {restUrl} Failed with Status Code {result.StatusCode} ({result.ReasonPhrase})");
}

if (restVerb.Equals("GET"))
{
result = httpClient.GetAsync(restUrl).Result;
Console.WriteLine($"REST Response: {result.Content.ReadAsStringAsync().Result}");
}

}

public static void SendTestEmail(string smtpHost, int smtpPort, string emailRecipient)
Expand Down
3 changes: 2 additions & 1 deletion Tools/src/JiraReporting/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"profiles": {
"JiraReporting": {
"commandName": "Project"
"commandName": "Project",
"commandLineArgs": "--JiraEndpoint \"https://allianzpartnersaustralia.atlassian.net\" --JiraProject \"AST\" --JiraUsername \"[email protected]\" --JiraAuthenticationToken \"iqAwykgOvn6Pm3cKpX8c81D6\" --PowerBiDatasetEndpoint \"https://api.powerbi.com/beta/d043a8fb-361f-45e7-a6e7-28ebf566c84a/datasets/7f94ce8b-ab82-4143-936f-1f6e32ed69de/rows?key=yAZGEdX29dbfdFaNDwsYzbA6aE3rwyODe7VXJ49Wdb4GeY8gLqX1hALRm4prTzKFmve677OM%2BSWoNz0UhhA7bA%3D%3D\""
}
}
}

0 comments on commit e870662

Please sign in to comment.