Class MockAssetServiceConnection (2.19.0)

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
TypeDescription
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
NameDescription
request google::cloud::asset::v1::ExportAssetsRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::ListAssetsRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::BatchGetAssetsHistoryRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::CreateFeedRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::GetFeedRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::ListFeedsRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::UpdateFeedRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::DeleteFeedRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::SearchAllResourcesRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::SearchAllIamPoliciesRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeIamPolicyRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeIamPolicyLongrunningRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeMoveRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::QueryAssetsRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::CreateSavedQueryRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::GetSavedQueryRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::ListSavedQueriesRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::UpdateSavedQueryRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::DeleteSavedQueryRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::BatchGetEffectiveIamPoliciesRequest const &
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeOrgPoliciesRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeOrgPolicyGovernedContainersRequest
Returns
TypeDescription
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
NameDescription
request google::cloud::asset::v1::AnalyzeOrgPolicyGovernedAssetsRequest
Returns
TypeDescription
StreamRange< google::cloud::asset::v1::AnalyzeOrgPolicyGovernedAssetsResponse::GovernedAsset >