Send feedback
Class MockAppHubConnection (2.30.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.30.0 keyboard_arrow_down
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
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::LookupServiceProjectAttachmentRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::ListServiceProjectAttachmentsRequest
Returns
Type
Description
StreamRange< google::cloud::apphub::v1::ServiceProjectAttachment >
virtual CreateServiceProjectAttachment(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::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
Name
Description
request
google::cloud::apphub::v1::GetServiceProjectAttachmentRequest const &
Returns
Type
Description
StatusOr< google::cloud::apphub::v1::ServiceProjectAttachment >
virtual DeleteServiceProjectAttachment(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::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
Name
Description
request
google::cloud::apphub::v1::DetachServiceProjectAttachmentRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::ListDiscoveredServicesRequest
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::GetDiscoveredServiceRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::LookupDiscoveredServiceRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::ListServicesRequest
Returns
Type
Description
StreamRange< google::cloud::apphub::v1::Service >
virtual CreateService(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::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
Name
Description
request
google::cloud::apphub::v1::GetServiceRequest const &
Returns
Type
Description
StatusOr< google::cloud::apphub::v1::Service >
virtual UpdateService(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::apphub::v1::Service > >
virtual DeleteService(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::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
Name
Description
request
google::cloud::apphub::v1::ListDiscoveredWorkloadsRequest
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::GetDiscoveredWorkloadRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::LookupDiscoveredWorkloadRequest const &
Returns
Type
Description
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
Name
Description
request
google::cloud::apphub::v1::ListWorkloadsRequest
Returns
Type
Description
StreamRange< google::cloud::apphub::v1::Workload >
virtual CreateWorkload(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::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
Name
Description
request
google::cloud::apphub::v1::GetWorkloadRequest const &
Returns
Type
Description
StatusOr< google::cloud::apphub::v1::Workload >
virtual UpdateWorkload(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::apphub::v1::Workload > >
virtual DeleteWorkload(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::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
Name
Description
request
google::cloud::apphub::v1::ListApplicationsRequest
Returns
Type
Description
StreamRange< google::cloud::apphub::v1::Application >
virtual CreateApplication(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::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
Name
Description
request
google::cloud::apphub::v1::GetApplicationRequest const &
Returns
Type
Description
StatusOr< google::cloud::apphub::v1::Application >
virtual UpdateApplication(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::apphub::v1::Application > >
virtual DeleteApplication(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::apphub::v1::OperationMetadata > >
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-28 UTC.
Need to tell us more?
[[["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-01-28 UTC."],[],[]]