A class to mock AssetServiceConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type AssetServiceClient
. To do so, construct an object of type AssetServiceClient
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 ExportAssets(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::asset::v1::ExportAssetsResponse > > |
|
virtual ListAssets(google::cloud::asset::v1::ListAssetsRequest)
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::asset::v1::ListAssetsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::Asset > |
|
virtual BatchGetAssetsHistory(google::cloud::asset::v1::BatchGetAssetsHistoryRequest 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::asset::v1::BatchGetAssetsHistoryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::BatchGetAssetsHistoryResponse > |
|
virtual CreateFeed(google::cloud::asset::v1::CreateFeedRequest 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::asset::v1::CreateFeedRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::Feed > |
|
virtual GetFeed(google::cloud::asset::v1::GetFeedRequest 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::asset::v1::GetFeedRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::Feed > |
|
virtual ListFeeds(google::cloud::asset::v1::ListFeedsRequest 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::asset::v1::ListFeedsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::ListFeedsResponse > |
|
virtual UpdateFeed(google::cloud::asset::v1::UpdateFeedRequest 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::asset::v1::UpdateFeedRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::Feed > |
|
virtual DeleteFeed(google::cloud::asset::v1::DeleteFeedRequest 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::asset::v1::DeleteFeedRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual SearchAllResources(google::cloud::asset::v1::SearchAllResourcesRequest)
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::asset::v1::SearchAllResourcesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::ResourceSearchResult > |
|
virtual SearchAllIamPolicies(google::cloud::asset::v1::SearchAllIamPoliciesRequest)
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::asset::v1::SearchAllIamPoliciesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::IamPolicySearchResult > |
|
virtual AnalyzeIamPolicy(google::cloud::asset::v1::AnalyzeIamPolicyRequest 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::asset::v1::AnalyzeIamPolicyRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::AnalyzeIamPolicyResponse > |
|
virtual AnalyzeIamPolicyLongrunning(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::asset::v1::AnalyzeIamPolicyLongrunningResponse > > |
|
virtual AnalyzeMove(google::cloud::asset::v1::AnalyzeMoveRequest 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::asset::v1::AnalyzeMoveRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::AnalyzeMoveResponse > |
|
virtual QueryAssets(google::cloud::asset::v1::QueryAssetsRequest 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::asset::v1::QueryAssetsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::QueryAssetsResponse > |
|
virtual CreateSavedQuery(google::cloud::asset::v1::CreateSavedQueryRequest 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::asset::v1::CreateSavedQueryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::SavedQuery > |
|
virtual GetSavedQuery(google::cloud::asset::v1::GetSavedQueryRequest 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::asset::v1::GetSavedQueryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::SavedQuery > |
|
virtual ListSavedQueries(google::cloud::asset::v1::ListSavedQueriesRequest)
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::asset::v1::ListSavedQueriesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::SavedQuery > |
|
virtual UpdateSavedQuery(google::cloud::asset::v1::UpdateSavedQueryRequest 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::asset::v1::UpdateSavedQueryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::SavedQuery > |
|
virtual DeleteSavedQuery(google::cloud::asset::v1::DeleteSavedQueryRequest 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::asset::v1::DeleteSavedQueryRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual BatchGetEffectiveIamPolicies(google::cloud::asset::v1::BatchGetEffectiveIamPoliciesRequest 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::asset::v1::BatchGetEffectiveIamPoliciesRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::asset::v1::BatchGetEffectiveIamPoliciesResponse > |
|
virtual AnalyzeOrgPolicies(google::cloud::asset::v1::AnalyzeOrgPoliciesRequest)
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::asset::v1::AnalyzeOrgPoliciesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::AnalyzeOrgPoliciesResponse::OrgPolicyResult > |
|
virtual AnalyzeOrgPolicyGovernedContainers(google::cloud::asset::v1::AnalyzeOrgPolicyGovernedContainersRequest)
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::asset::v1::AnalyzeOrgPolicyGovernedContainersRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::AnalyzeOrgPolicyGovernedContainersResponse::GovernedContainer > |
|
virtual AnalyzeOrgPolicyGovernedAssets(google::cloud::asset::v1::AnalyzeOrgPolicyGovernedAssetsRequest)
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::asset::v1::AnalyzeOrgPolicyGovernedAssetsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::asset::v1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset > |
|
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 > |
|