Application developers may want to test their code with simulated responses, including errors, from an object of type ServiceHealthClient. To do so, construct an object of type ServiceHealthClient with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.
See Also
This example for how to test your application with GoogleTest. While the example showcases types from the BigQuery library, the underlying principles apply for any pair of *Client and *Connection.
Functions
virtual options()
This function is implemented using gMock's MOCK_METHOD().
Consult the gMock documentation to use this mock in your tests.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["This webpage details the `MockServiceHealthConnection` class, which is designed to facilitate testing of applications using `ServiceHealthClient` by providing simulated responses and error handling."],["The `MockServiceHealthConnection` class is implemented using Google Test's gMock framework, allowing for easy mocking of functions like `options()`, `ListEvents()`, `GetEvent()`, `ListOrganizationEvents()`, `GetOrganizationEvent()`, `ListOrganizationImpacts()`, and `GetOrganizationImpact()`."],["The page provides a comprehensive list of class functions and their corresponding parameter and return types, with descriptions, to enable users to effectively implement and understand the mock behaviors in their testing code."],["The webpage provides a link to a practical example of how to use mock objects within the BigQuery library, which is a relevant analogy for understanding how to use the mock classes for service health."],["The webpage features numerous version releases, starting from version 2.21.0 all the way to the latest version 2.37.0-rc, all of which are available and linked for users."]]],[]]