Send feedback
Class MockAssetServiceConnection (2.23.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.23.0 keyboard_arrow_down
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::cloud::asset::v1::ExportAssetsRequest 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::ExportAssetsRequest 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::cloud::asset::v1::AnalyzeIamPolicyLongrunningRequest 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::AnalyzeIamPolicyLongrunningRequest 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 >
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-27 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-27 UTC."],[],[]]