Class MockDatastreamConnection (2.21.0)

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
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::ListConnectionProfilesRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::GetConnectionProfileRequest const &
Returns
TypeDescription
StatusOr< google::cloud::datastream::v1::ConnectionProfile >

virtual CreateConnectionProfile(google::cloud::datastream::v1::CreateConnectionProfileRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::CreateConnectionProfileRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::ConnectionProfile > >

virtual UpdateConnectionProfile(google::cloud::datastream::v1::UpdateConnectionProfileRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::UpdateConnectionProfileRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::ConnectionProfile > >

virtual DeleteConnectionProfile(google::cloud::datastream::v1::DeleteConnectionProfileRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::DeleteConnectionProfileRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::DiscoverConnectionProfileRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::ListStreamsRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::GetStreamRequest const &
Returns
TypeDescription
StatusOr< google::cloud::datastream::v1::Stream >

virtual CreateStream(google::cloud::datastream::v1::CreateStreamRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::CreateStreamRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::Stream > >

virtual UpdateStream(google::cloud::datastream::v1::UpdateStreamRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::UpdateStreamRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::Stream > >

virtual DeleteStream(google::cloud::datastream::v1::DeleteStreamRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::DeleteStreamRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > >

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
NameDescription
request google::cloud::datastream::v1::GetStreamObjectRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::LookupStreamObjectRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::ListStreamObjectsRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::StartBackfillJobRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::StopBackfillJobRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::FetchStaticIpsRequest
Returns
TypeDescription
StreamRange< std::string >

virtual CreatePrivateConnection(google::cloud::datastream::v1::CreatePrivateConnectionRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::CreatePrivateConnectionRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::GetPrivateConnectionRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::ListPrivateConnectionsRequest
Returns
TypeDescription
StreamRange< google::cloud::datastream::v1::PrivateConnection >

virtual DeletePrivateConnection(google::cloud::datastream::v1::DeletePrivateConnectionRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::DeletePrivateConnectionRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > >

virtual CreateRoute(google::cloud::datastream::v1::CreateRouteRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::CreateRouteRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::GetRouteRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::datastream::v1::ListRoutesRequest
Returns
TypeDescription
StreamRange< google::cloud::datastream::v1::Route >

virtual DeleteRoute(google::cloud::datastream::v1::DeleteRouteRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::cloud::datastream::v1::DeleteRouteRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::datastream::v1::OperationMetadata > >