Class MockSecurityCenterConnection (2.28.0)

A class to mock SecurityCenterConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type SecurityCenterClient. To do so, construct an object of type SecurityCenterClient 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 BatchCreateResourceValueConfigs(google::cloud::securitycenter::v2::BatchCreateResourceValueConfigsRequest 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::securitycenter::v2::BatchCreateResourceValueConfigsRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::BatchCreateResourceValueConfigsResponse >

virtual BulkMuteFindings(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::securitycenter::v2::BulkMuteFindingsResponse > >

virtual CreateBigQueryExport(google::cloud::securitycenter::v2::CreateBigQueryExportRequest 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::securitycenter::v2::CreateBigQueryExportRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::BigQueryExport >

virtual CreateFinding(google::cloud::securitycenter::v2::CreateFindingRequest 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::securitycenter::v2::CreateFindingRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Finding >

virtual CreateMuteConfig(google::cloud::securitycenter::v2::CreateMuteConfigRequest 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::securitycenter::v2::CreateMuteConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::MuteConfig >

virtual CreateNotificationConfig(google::cloud::securitycenter::v2::CreateNotificationConfigRequest 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::securitycenter::v2::CreateNotificationConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::NotificationConfig >

virtual CreateSource(google::cloud::securitycenter::v2::CreateSourceRequest 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::securitycenter::v2::CreateSourceRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Source >

virtual DeleteBigQueryExport(google::cloud::securitycenter::v2::DeleteBigQueryExportRequest 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::securitycenter::v2::DeleteBigQueryExportRequest const &
Returns
Type Description
Status

virtual DeleteMuteConfig(google::cloud::securitycenter::v2::DeleteMuteConfigRequest 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::securitycenter::v2::DeleteMuteConfigRequest const &
Returns
Type Description
Status

virtual DeleteNotificationConfig(google::cloud::securitycenter::v2::DeleteNotificationConfigRequest 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::securitycenter::v2::DeleteNotificationConfigRequest const &
Returns
Type Description
Status

virtual DeleteResourceValueConfig(google::cloud::securitycenter::v2::DeleteResourceValueConfigRequest 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::securitycenter::v2::DeleteResourceValueConfigRequest const &
Returns
Type Description
Status

virtual GetBigQueryExport(google::cloud::securitycenter::v2::GetBigQueryExportRequest 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::securitycenter::v2::GetBigQueryExportRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::BigQueryExport >

virtual GetSimulation(google::cloud::securitycenter::v2::GetSimulationRequest 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::securitycenter::v2::GetSimulationRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Simulation >

virtual GetValuedResource(google::cloud::securitycenter::v2::GetValuedResourceRequest 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::securitycenter::v2::GetValuedResourceRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::ValuedResource >

virtual GetIamPolicy(google::iam::v1::GetIamPolicyRequest 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::iam::v1::GetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::iam::v1::Policy >

virtual GetMuteConfig(google::cloud::securitycenter::v2::GetMuteConfigRequest 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::securitycenter::v2::GetMuteConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::MuteConfig >

virtual GetNotificationConfig(google::cloud::securitycenter::v2::GetNotificationConfigRequest 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::securitycenter::v2::GetNotificationConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::NotificationConfig >

virtual GetResourceValueConfig(google::cloud::securitycenter::v2::GetResourceValueConfigRequest 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::securitycenter::v2::GetResourceValueConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::ResourceValueConfig >

virtual GetSource(google::cloud::securitycenter::v2::GetSourceRequest 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::securitycenter::v2::GetSourceRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Source >

virtual GroupFindings(google::cloud::securitycenter::v2::GroupFindingsRequest)

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::securitycenter::v2::GroupFindingsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::GroupResult >

virtual ListAttackPaths(google::cloud::securitycenter::v2::ListAttackPathsRequest)

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::securitycenter::v2::ListAttackPathsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::AttackPath >

virtual ListBigQueryExports(google::cloud::securitycenter::v2::ListBigQueryExportsRequest)

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::securitycenter::v2::ListBigQueryExportsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::BigQueryExport >

virtual ListFindings(google::cloud::securitycenter::v2::ListFindingsRequest)

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::securitycenter::v2::ListFindingsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::ListFindingsResponse::ListFindingsResult >

virtual ListMuteConfigs(google::cloud::securitycenter::v2::ListMuteConfigsRequest)

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::securitycenter::v2::ListMuteConfigsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::MuteConfig >

virtual ListNotificationConfigs(google::cloud::securitycenter::v2::ListNotificationConfigsRequest)

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::securitycenter::v2::ListNotificationConfigsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::NotificationConfig >

virtual ListResourceValueConfigs(google::cloud::securitycenter::v2::ListResourceValueConfigsRequest)

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::securitycenter::v2::ListResourceValueConfigsRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::ResourceValueConfig >

virtual ListSources(google::cloud::securitycenter::v2::ListSourcesRequest)

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::securitycenter::v2::ListSourcesRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::Source >

virtual ListValuedResources(google::cloud::securitycenter::v2::ListValuedResourcesRequest)

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::securitycenter::v2::ListValuedResourcesRequest
Returns
Type Description
StreamRange< google::cloud::securitycenter::v2::ValuedResource >

virtual SetFindingState(google::cloud::securitycenter::v2::SetFindingStateRequest 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::securitycenter::v2::SetFindingStateRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Finding >

virtual SetIamPolicy(google::iam::v1::SetIamPolicyRequest 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::iam::v1::SetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::iam::v1::Policy >

virtual SetMute(google::cloud::securitycenter::v2::SetMuteRequest 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::securitycenter::v2::SetMuteRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Finding >

virtual TestIamPermissions(google::iam::v1::TestIamPermissionsRequest 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::iam::v1::TestIamPermissionsRequest const &
Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

virtual UpdateBigQueryExport(google::cloud::securitycenter::v2::UpdateBigQueryExportRequest 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::securitycenter::v2::UpdateBigQueryExportRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::BigQueryExport >

virtual UpdateExternalSystem(google::cloud::securitycenter::v2::UpdateExternalSystemRequest 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::securitycenter::v2::UpdateExternalSystemRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::ExternalSystem >

virtual UpdateFinding(google::cloud::securitycenter::v2::UpdateFindingRequest 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::securitycenter::v2::UpdateFindingRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Finding >

virtual UpdateMuteConfig(google::cloud::securitycenter::v2::UpdateMuteConfigRequest 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::securitycenter::v2::UpdateMuteConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::MuteConfig >

virtual UpdateNotificationConfig(google::cloud::securitycenter::v2::UpdateNotificationConfigRequest 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::securitycenter::v2::UpdateNotificationConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::NotificationConfig >

virtual UpdateResourceValueConfig(google::cloud::securitycenter::v2::UpdateResourceValueConfigRequest 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::securitycenter::v2::UpdateResourceValueConfigRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::ResourceValueConfig >

virtual UpdateSecurityMarks(google::cloud::securitycenter::v2::UpdateSecurityMarksRequest 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::securitycenter::v2::UpdateSecurityMarksRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::SecurityMarks >

virtual UpdateSource(google::cloud::securitycenter::v2::UpdateSourceRequest 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::securitycenter::v2::UpdateSourceRequest const &
Returns
Type Description
StatusOr< google::cloud::securitycenter::v2::Source >