Application developers may want to test their code with simulated responses, including errors, from an object of type MetadataServiceClient. To do so, construct an object of type MetadataServiceClient 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-04-09 UTC."],[[["This webpage documents the `MockMetadataServiceConnection` class, which is designed to facilitate testing of applications using `MetadataServiceClient` by simulating responses, including errors."],["The class is part of the Google Cloud Dataplex C++ library and includes mock implementations for various functions like creating, updating, deleting, getting, and listing entities and partitions."],["The latest version documented on this webpage is `2.37.0-rc`, while a wide array of previous versions down to `2.11.0` are also detailed, which allows developers to look into and implement the version which is the most useful for them."],["Each function within `MockMetadataServiceConnection`, such as `CreateEntity`, `GetPartition`, and `ListEntities`, utilizes gMock's `MOCK_METHOD()` and is documented with its parameters and return types."],["The documentation provides a link to a GoogleTest example for bigquery that explains how to test applications with the provided Mock classes and can be applied to this use case."]]],[]]