A class to mock DatastreamConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type DatastreamClient
. To do so, construct an object of type DatastreamClient
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.
Returns |
Type |
Description |
Options |
|
virtual ListConnectionProfiles(google::cloud::datastream::v1::ListConnectionProfilesRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::ListConnectionProfilesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::datastream::v1::ConnectionProfile > |
|
virtual GetConnectionProfile(google::cloud::datastream::v1::GetConnectionProfileRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::GetConnectionProfileRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::ConnectionProfile > |
|
virtual CreateConnectionProfile(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::ConnectionProfile > > |
|
virtual UpdateConnectionProfile(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::ConnectionProfile > > |
|
virtual DeleteConnectionProfile(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > > |
|
virtual DiscoverConnectionProfile(google::cloud::datastream::v1::DiscoverConnectionProfileRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::DiscoverConnectionProfileRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::DiscoverConnectionProfileResponse > |
|
virtual ListStreams(google::cloud::datastream::v1::ListStreamsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::ListStreamsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::datastream::v1::Stream > |
|
virtual GetStream(google::cloud::datastream::v1::GetStreamRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::GetStreamRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::Stream > |
|
virtual CreateStream(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::Stream > > |
|
virtual UpdateStream(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::Stream > > |
|
virtual DeleteStream(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > > |
|
virtual RunStream(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::Stream > > |
|
virtual GetStreamObject(google::cloud::datastream::v1::GetStreamObjectRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::GetStreamObjectRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::StreamObject > |
|
virtual LookupStreamObject(google::cloud::datastream::v1::LookupStreamObjectRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::LookupStreamObjectRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::StreamObject > |
|
virtual ListStreamObjects(google::cloud::datastream::v1::ListStreamObjectsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::ListStreamObjectsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::datastream::v1::StreamObject > |
|
virtual StartBackfillJob(google::cloud::datastream::v1::StartBackfillJobRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::StartBackfillJobRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::StartBackfillJobResponse > |
|
virtual StopBackfillJob(google::cloud::datastream::v1::StopBackfillJobRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::StopBackfillJobRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::StopBackfillJobResponse > |
|
virtual FetchStaticIps(google::cloud::datastream::v1::FetchStaticIpsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::FetchStaticIpsRequest
|
Returns |
Type |
Description |
StreamRange< std::string > |
|
virtual CreatePrivateConnection(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::PrivateConnection > > |
|
virtual GetPrivateConnection(google::cloud::datastream::v1::GetPrivateConnectionRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::GetPrivateConnectionRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::PrivateConnection > |
|
virtual ListPrivateConnections(google::cloud::datastream::v1::ListPrivateConnectionsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::ListPrivateConnectionsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::datastream::v1::PrivateConnection > |
|
virtual DeletePrivateConnection(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > > |
|
virtual CreateRoute(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::Route > > |
|
virtual GetRoute(google::cloud::datastream::v1::GetRouteRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::GetRouteRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::datastream::v1::Route > |
|
virtual ListRoutes(google::cloud::datastream::v1::ListRoutesRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::datastream::v1::ListRoutesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::datastream::v1::Route > |
|
virtual DeleteRoute(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > > |
|
virtual ListLocations(google::cloud::location::ListLocationsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::location::ListLocationsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::location::Location > |
|
virtual GetLocation(google::cloud::location::GetLocationRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::cloud::location::GetLocationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::location::Location > |
|
virtual ListOperations(google::longrunning::ListOperationsRequest)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::longrunning::ListOperationsRequest
|
Returns |
Type |
Description |
StreamRange< google::longrunning::Operation > |
|
virtual GetOperation(google::longrunning::GetOperationRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::longrunning::GetOperationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::longrunning::Operation > |
|
virtual DeleteOperation(google::longrunning::DeleteOperationRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::longrunning::DeleteOperationRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual CancelOperation(google::longrunning::CancelOperationRequest const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
request |
google::longrunning::CancelOperationRequest const &
|
Returns |
Type |
Description |
Status |
|