Class MockSecretManagerServiceConnection (2.16.0-rc)

A class to mock SecretManagerServiceConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type SecretManagerServiceClient. To do so, construct an object of type SecretManagerServiceClient 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 ListSecrets(google::cloud::secretmanager::v1::ListSecretsRequest)

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::secretmanager::v1::ListSecretsRequest
Returns
TypeDescription
StreamRange< google::cloud::secretmanager::v1::Secret >

virtual CreateSecret(google::cloud::secretmanager::v1::CreateSecretRequest 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::secretmanager::v1::CreateSecretRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::Secret >

virtual AddSecretVersion(google::cloud::secretmanager::v1::AddSecretVersionRequest 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::secretmanager::v1::AddSecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

virtual GetSecret(google::cloud::secretmanager::v1::GetSecretRequest 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::secretmanager::v1::GetSecretRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::Secret >

virtual UpdateSecret(google::cloud::secretmanager::v1::UpdateSecretRequest 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::secretmanager::v1::UpdateSecretRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::Secret >

virtual DeleteSecret(google::cloud::secretmanager::v1::DeleteSecretRequest 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::secretmanager::v1::DeleteSecretRequest const &
Returns
TypeDescription
Status

virtual ListSecretVersions(google::cloud::secretmanager::v1::ListSecretVersionsRequest)

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::secretmanager::v1::ListSecretVersionsRequest
Returns
TypeDescription
StreamRange< google::cloud::secretmanager::v1::SecretVersion >

virtual GetSecretVersion(google::cloud::secretmanager::v1::GetSecretVersionRequest 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::secretmanager::v1::GetSecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

virtual AccessSecretVersion(google::cloud::secretmanager::v1::AccessSecretVersionRequest 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::secretmanager::v1::AccessSecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse >

virtual DisableSecretVersion(google::cloud::secretmanager::v1::DisableSecretVersionRequest 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::secretmanager::v1::DisableSecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

virtual EnableSecretVersion(google::cloud::secretmanager::v1::EnableSecretVersionRequest 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::secretmanager::v1::EnableSecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

virtual DestroySecretVersion(google::cloud::secretmanager::v1::DestroySecretVersionRequest 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::secretmanager::v1::DestroySecretVersionRequest const &
Returns
TypeDescription
StatusOr< google::cloud::secretmanager::v1::SecretVersion >

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
NameDescription
request google::iam::v1::SetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

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
NameDescription
request google::iam::v1::GetIamPolicyRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

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
NameDescription
request google::iam::v1::TestIamPermissionsRequest const &
Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >