Application developers may want to test their code with simulated responses, including errors, from an object of type ServiceManagerClient. To do so, construct an object of type ServiceManagerClient 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-08-14 UTC."],[[["\u003cp\u003eThis page details the \u003ccode\u003eMockServiceManagerConnection\u003c/code\u003e class, which is designed to facilitate testing of applications using \u003ccode\u003eServiceManagerClient\u003c/code\u003e by providing simulated responses.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available for the \u003ccode\u003eMockServiceManagerConnection\u003c/code\u003e class is version 2.37.0-rc, and there are numerous previous versions listed down to version 2.11.0 for developers to use if they choose not to use the latest version.\u003c/p\u003e\n"],["\u003cp\u003eThe class uses Google Test's gMock framework to implement its methods, allowing for the programming of mock behaviors and responses for various service management operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMockServiceManagerConnection\u003c/code\u003e class supports a wide array of virtual functions, such as managing services, configurations, rollouts, and IAM policies, all implemented with gMock for testing.\u003c/p\u003e\n"],["\u003cp\u003eThe provided documentation explains how to use the \u003ccode\u003eMockServiceManagerConnection\u003c/code\u003e class and gMock to test applications with examples of the various available functions and what they return.\u003c/p\u003e\n"]]],[],null,[]]