Class google::cloud::kms_v1_mocks::MockKeyManagementServiceConnection (2.10.1)

A class to mock KeyManagementServiceConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type KeyManagementServiceClient. To do so, construct an object of type KeyManagementServiceClient 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

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

ListKeyRings

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::kms::v1::ListKeyRingsRequest
Returns
Type Description
StreamRange< google::cloud::kms::v1::KeyRing >

ListCryptoKeys

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::kms::v1::ListCryptoKeysRequest
Returns
Type Description
StreamRange< google::cloud::kms::v1::CryptoKey >

ListCryptoKeyVersions

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::kms::v1::ListCryptoKeyVersionsRequest
Returns
Type Description
StreamRange< google::cloud::kms::v1::CryptoKeyVersion >

ListImportJobs

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::kms::v1::ListImportJobsRequest
Returns
Type Description
StreamRange< google::cloud::kms::v1::ImportJob >

GetKeyRing

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::kms::v1::GetKeyRingRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::KeyRing >

GetCryptoKey

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::kms::v1::GetCryptoKeyRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKey >

GetCryptoKeyVersion

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::kms::v1::GetCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

GetPublicKey

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::kms::v1::GetPublicKeyRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::PublicKey >

GetImportJob

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::kms::v1::GetImportJobRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::ImportJob >

CreateKeyRing

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::kms::v1::CreateKeyRingRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::KeyRing >

CreateCryptoKey

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::kms::v1::CreateCryptoKeyRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKey >

CreateCryptoKeyVersion

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::kms::v1::CreateCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

ImportCryptoKeyVersion

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::kms::v1::ImportCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

CreateImportJob

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::kms::v1::CreateImportJobRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::ImportJob >

UpdateCryptoKey

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::kms::v1::UpdateCryptoKeyRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKey >

UpdateCryptoKeyVersion

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::kms::v1::UpdateCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

UpdateCryptoKeyPrimaryVersion

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::kms::v1::UpdateCryptoKeyPrimaryVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKey >

DestroyCryptoKeyVersion

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::kms::v1::DestroyCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

RestoreCryptoKeyVersion

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::kms::v1::RestoreCryptoKeyVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >

Encrypt

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::kms::v1::EncryptRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::EncryptResponse >

Decrypt

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::kms::v1::DecryptRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::DecryptResponse >

AsymmetricSign

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::kms::v1::AsymmetricSignRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::AsymmetricSignResponse >

AsymmetricDecrypt

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::kms::v1::AsymmetricDecryptRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::AsymmetricDecryptResponse >

MacSign

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::kms::v1::MacSignRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::MacSignResponse >

MacVerify

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::kms::v1::MacVerifyRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::MacVerifyResponse >

GenerateRandomBytes

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::kms::v1::GenerateRandomBytesRequest const &
Returns
Type Description
StatusOr< google::cloud::kms::v1::GenerateRandomBytesResponse >