Class MockDeviceManagerConnection (2.14.0)

A class to mock DeviceManagerConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type DeviceManagerClient. To do so, construct an object of type DeviceManagerClient 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 CreateDeviceRegistry(google::cloud::iot::v1::CreateDeviceRegistryRequest 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::iot::v1::CreateDeviceRegistryRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::DeviceRegistry >

virtual GetDeviceRegistry(google::cloud::iot::v1::GetDeviceRegistryRequest 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::iot::v1::GetDeviceRegistryRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::DeviceRegistry >

virtual UpdateDeviceRegistry(google::cloud::iot::v1::UpdateDeviceRegistryRequest 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::iot::v1::UpdateDeviceRegistryRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::DeviceRegistry >

virtual DeleteDeviceRegistry(google::cloud::iot::v1::DeleteDeviceRegistryRequest 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::iot::v1::DeleteDeviceRegistryRequest const &
Returns
TypeDescription
Status

virtual ListDeviceRegistries(google::cloud::iot::v1::ListDeviceRegistriesRequest)

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::iot::v1::ListDeviceRegistriesRequest
Returns
TypeDescription
StreamRange< google::cloud::iot::v1::DeviceRegistry >

virtual CreateDevice(google::cloud::iot::v1::CreateDeviceRequest 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::iot::v1::CreateDeviceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::Device >

virtual GetDevice(google::cloud::iot::v1::GetDeviceRequest 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::iot::v1::GetDeviceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::Device >

virtual UpdateDevice(google::cloud::iot::v1::UpdateDeviceRequest 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::iot::v1::UpdateDeviceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::Device >

virtual DeleteDevice(google::cloud::iot::v1::DeleteDeviceRequest 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::iot::v1::DeleteDeviceRequest const &
Returns
TypeDescription
Status

virtual ListDevices(google::cloud::iot::v1::ListDevicesRequest)

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::iot::v1::ListDevicesRequest
Returns
TypeDescription
StreamRange< google::cloud::iot::v1::Device >

virtual ModifyCloudToDeviceConfig(google::cloud::iot::v1::ModifyCloudToDeviceConfigRequest 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::iot::v1::ModifyCloudToDeviceConfigRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::DeviceConfig >

virtual ListDeviceConfigVersions(google::cloud::iot::v1::ListDeviceConfigVersionsRequest 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::iot::v1::ListDeviceConfigVersionsRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::ListDeviceConfigVersionsResponse >

virtual ListDeviceStates(google::cloud::iot::v1::ListDeviceStatesRequest 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::iot::v1::ListDeviceStatesRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::ListDeviceStatesResponse >

virtual SetIamPolicy(google::iam::v1::SetIamPolicyRequest 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::iam::v1::SetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

virtual GetIamPolicy(google::iam::v1::GetIamPolicyRequest 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::iam::v1::GetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

virtual TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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::iam::v1::TestIamPermissionsRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual SendCommandToDevice(google::cloud::iot::v1::SendCommandToDeviceRequest 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::iot::v1::SendCommandToDeviceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::SendCommandToDeviceResponse >

virtual BindDeviceToGateway(google::cloud::iot::v1::BindDeviceToGatewayRequest 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::iot::v1::BindDeviceToGatewayRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::BindDeviceToGatewayResponse >

virtual UnbindDeviceFromGateway(google::cloud::iot::v1::UnbindDeviceFromGatewayRequest 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::iot::v1::UnbindDeviceFromGatewayRequest const &
Returns
TypeDescription
StatusOr< google::cloud::iot::v1::UnbindDeviceFromGatewayResponse >