Application developers may want to test their code with simulated responses, including errors, from an object of type DocumentSchemaServiceClient. To do so, construct an object of type DocumentSchemaServiceClient 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"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis webpage details the \u003ccode\u003eMockDocumentSchemaServiceConnection\u003c/code\u003e class, which is designed for mocking \u003ccode\u003eDocumentSchemaServiceClient\u003c/code\u003e objects in testing environments.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows for simulating responses and errors from a \u003ccode\u003eDocumentSchemaServiceClient\u003c/code\u003e, enabling developers to thoroughly test their application's interactions with the service.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation provides access to multiple versions of the \u003ccode\u003eMockDocumentSchemaServiceConnection\u003c/code\u003e, from the latest release candidate, 2.37.0-rc, to older versions, starting with 2.12.0.\u003c/p\u003e\n"],["\u003cp\u003eKey functions like \u003ccode\u003eCreateDocumentSchema\u003c/code\u003e, \u003ccode\u003eUpdateDocumentSchema\u003c/code\u003e, \u003ccode\u003eGetDocumentSchema\u003c/code\u003e, \u003ccode\u003eDeleteDocumentSchema\u003c/code\u003e, and \u003ccode\u003eListDocumentSchemas\u003c/code\u003e are all implemented using gMock's \u003ccode\u003eMOCK_METHOD()\u003c/code\u003e, allowing for customizable mock behavior during testing.\u003c/p\u003e\n"],["\u003cp\u003eThe webpage also shows an example of how to test applications using GoogleTest, applying to any pair of \u003ccode\u003e*Client\u003c/code\u003e and \u003ccode\u003e*Connection\u003c/code\u003e, despite the example showcasing types from BigQuery library.\u003c/p\u003e\n"]]],[],null,[]]