Class MockAppHubConnection (2.23.0-rc)

A class to mock AppHubConnection.

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

virtual ListServiceProjectAttachments(google::cloud::apphub::v1::ListServiceProjectAttachmentsRequest)

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::apphub::v1::ListServiceProjectAttachmentsRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::ServiceProjectAttachment >

virtual CreateServiceProjectAttachment(google::cloud::apphub::v1::CreateServiceProjectAttachmentRequest 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::apphub::v1::CreateServiceProjectAttachmentRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::ServiceProjectAttachment > >

virtual GetServiceProjectAttachment(google::cloud::apphub::v1::GetServiceProjectAttachmentRequest 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::apphub::v1::GetServiceProjectAttachmentRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::ServiceProjectAttachment >

virtual DeleteServiceProjectAttachment(google::cloud::apphub::v1::DeleteServiceProjectAttachmentRequest 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::apphub::v1::DeleteServiceProjectAttachmentRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::OperationMetadata > >

virtual DetachServiceProjectAttachment(google::cloud::apphub::v1::DetachServiceProjectAttachmentRequest 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::apphub::v1::DetachServiceProjectAttachmentRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::DetachServiceProjectAttachmentResponse >

virtual ListDiscoveredServices(google::cloud::apphub::v1::ListDiscoveredServicesRequest)

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::apphub::v1::ListDiscoveredServicesRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::DiscoveredService >

virtual GetDiscoveredService(google::cloud::apphub::v1::GetDiscoveredServiceRequest 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::apphub::v1::GetDiscoveredServiceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::DiscoveredService >

virtual LookupDiscoveredService(google::cloud::apphub::v1::LookupDiscoveredServiceRequest 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::apphub::v1::LookupDiscoveredServiceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::LookupDiscoveredServiceResponse >

virtual ListServices(google::cloud::apphub::v1::ListServicesRequest)

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::apphub::v1::ListServicesRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::Service >

virtual CreateService(google::cloud::apphub::v1::CreateServiceRequest 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::apphub::v1::CreateServiceRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Service > >

virtual GetService(google::cloud::apphub::v1::GetServiceRequest 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::apphub::v1::GetServiceRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::Service >

virtual UpdateService(google::cloud::apphub::v1::UpdateServiceRequest 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::apphub::v1::UpdateServiceRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Service > >

virtual DeleteService(google::cloud::apphub::v1::DeleteServiceRequest 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::apphub::v1::DeleteServiceRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::OperationMetadata > >

virtual ListDiscoveredWorkloads(google::cloud::apphub::v1::ListDiscoveredWorkloadsRequest)

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::apphub::v1::ListDiscoveredWorkloadsRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::DiscoveredWorkload >

virtual GetDiscoveredWorkload(google::cloud::apphub::v1::GetDiscoveredWorkloadRequest 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::apphub::v1::GetDiscoveredWorkloadRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::DiscoveredWorkload >

virtual LookupDiscoveredWorkload(google::cloud::apphub::v1::LookupDiscoveredWorkloadRequest 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::apphub::v1::LookupDiscoveredWorkloadRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::LookupDiscoveredWorkloadResponse >

virtual ListWorkloads(google::cloud::apphub::v1::ListWorkloadsRequest)

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::apphub::v1::ListWorkloadsRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::Workload >

virtual CreateWorkload(google::cloud::apphub::v1::CreateWorkloadRequest 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::apphub::v1::CreateWorkloadRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Workload > >

virtual GetWorkload(google::cloud::apphub::v1::GetWorkloadRequest 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::apphub::v1::GetWorkloadRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::Workload >

virtual UpdateWorkload(google::cloud::apphub::v1::UpdateWorkloadRequest 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::apphub::v1::UpdateWorkloadRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Workload > >

virtual DeleteWorkload(google::cloud::apphub::v1::DeleteWorkloadRequest 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::apphub::v1::DeleteWorkloadRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::OperationMetadata > >

virtual ListApplications(google::cloud::apphub::v1::ListApplicationsRequest)

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::apphub::v1::ListApplicationsRequest
Returns
TypeDescription
StreamRange< google::cloud::apphub::v1::Application >

virtual CreateApplication(google::cloud::apphub::v1::CreateApplicationRequest 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::apphub::v1::CreateApplicationRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Application > >

virtual GetApplication(google::cloud::apphub::v1::GetApplicationRequest 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::apphub::v1::GetApplicationRequest const &
Returns
TypeDescription
StatusOr< google::cloud::apphub::v1::Application >

virtual UpdateApplication(google::cloud::apphub::v1::UpdateApplicationRequest 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::apphub::v1::UpdateApplicationRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::Application > >

virtual DeleteApplication(google::cloud::apphub::v1::DeleteApplicationRequest 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::apphub::v1::DeleteApplicationRequest const &
Returns
TypeDescription
future< StatusOr< google::cloud::apphub::v1::OperationMetadata > >