[Health]: Test Case for Rest and GraphQL Requests to DAB during health check
Why make this change?
Resolves #2662
What is this change?
- Created the HttpUtilities with HttpClient already instantiated and basic details filled from Startup.cs
- Using this httpClient, call the REST and GraphQL requests with relative URI
- Created a function in DatabaseObject to access mapping dict as it is an abstract class which was not allowed to be mocked.
- Test cases for both REST and GraphQL
- Rest Test case: Mock the client to return a 200 response when we receive a GET request with specific URI. Validate the error message from HttpUtilities should be null.
- GraphQL Test case: Mock the client to return a 200 response when we get a POST request with /graphql URI and content payload. Mock the Dabase Object with columns in the entity map to only return the db object when a certain entity is called for.
How was this tested?
- [ ] Integration Tests
- [x] Unit Tests
Sample Request(s)
Requests are running as expected. Test cases added for Rest and Graphql
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).
/azp run
Azure Pipelines successfully started running 6 pipeline(s).