Send feedback
Class MockKeyManagementServiceConnection (2.18.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.18.0 keyboard_arrow_down
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
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 ListKeyRings(google::cloud::kms::v1::ListKeyRingsRequest)
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 >
virtual ListCryptoKeys(google::cloud::kms::v1::ListCryptoKeysRequest)
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 >
virtual ListCryptoKeyVersions(google::cloud::kms::v1::ListCryptoKeyVersionsRequest)
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 >
virtual ListImportJobs(google::cloud::kms::v1::ListImportJobsRequest)
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 >
virtual GetKeyRing(google::cloud::kms::v1::GetKeyRingRequest 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::kms::v1::GetKeyRingRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::KeyRing >
virtual GetCryptoKey(google::cloud::kms::v1::GetCryptoKeyRequest 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::kms::v1::GetCryptoKeyRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKey >
virtual GetCryptoKeyVersion(google::cloud::kms::v1::GetCryptoKeyVersionRequest 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::kms::v1::GetCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual GetPublicKey(google::cloud::kms::v1::GetPublicKeyRequest 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::kms::v1::GetPublicKeyRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::PublicKey >
virtual GetImportJob(google::cloud::kms::v1::GetImportJobRequest 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::kms::v1::GetImportJobRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::ImportJob >
virtual CreateKeyRing(google::cloud::kms::v1::CreateKeyRingRequest 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::kms::v1::CreateKeyRingRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::KeyRing >
virtual CreateCryptoKey(google::cloud::kms::v1::CreateCryptoKeyRequest 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::kms::v1::CreateCryptoKeyRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKey >
virtual CreateCryptoKeyVersion(google::cloud::kms::v1::CreateCryptoKeyVersionRequest 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::kms::v1::CreateCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual ImportCryptoKeyVersion(google::cloud::kms::v1::ImportCryptoKeyVersionRequest 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::kms::v1::ImportCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual CreateImportJob(google::cloud::kms::v1::CreateImportJobRequest 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::kms::v1::CreateImportJobRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::ImportJob >
virtual UpdateCryptoKey(google::cloud::kms::v1::UpdateCryptoKeyRequest 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::kms::v1::UpdateCryptoKeyRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKey >
virtual UpdateCryptoKeyVersion(google::cloud::kms::v1::UpdateCryptoKeyVersionRequest 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::kms::v1::UpdateCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual UpdateCryptoKeyPrimaryVersion(google::cloud::kms::v1::UpdateCryptoKeyPrimaryVersionRequest 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::kms::v1::UpdateCryptoKeyPrimaryVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKey >
virtual DestroyCryptoKeyVersion(google::cloud::kms::v1::DestroyCryptoKeyVersionRequest 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::kms::v1::DestroyCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual RestoreCryptoKeyVersion(google::cloud::kms::v1::RestoreCryptoKeyVersionRequest 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::kms::v1::RestoreCryptoKeyVersionRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::CryptoKeyVersion >
virtual Encrypt(google::cloud::kms::v1::EncryptRequest 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::kms::v1::EncryptRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::EncryptResponse >
virtual Decrypt(google::cloud::kms::v1::DecryptRequest 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::kms::v1::DecryptRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::DecryptResponse >
virtual RawEncrypt(google::cloud::kms::v1::RawEncryptRequest 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::kms::v1::RawEncryptRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::RawEncryptResponse >
virtual RawDecrypt(google::cloud::kms::v1::RawDecryptRequest 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::kms::v1::RawDecryptRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::RawDecryptResponse >
virtual AsymmetricSign(google::cloud::kms::v1::AsymmetricSignRequest 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::kms::v1::AsymmetricSignRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::AsymmetricSignResponse >
virtual AsymmetricDecrypt(google::cloud::kms::v1::AsymmetricDecryptRequest 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::kms::v1::AsymmetricDecryptRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::AsymmetricDecryptResponse >
virtual MacSign(google::cloud::kms::v1::MacSignRequest 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::kms::v1::MacSignRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::MacSignResponse >
virtual MacVerify(google::cloud::kms::v1::MacVerifyRequest 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::kms::v1::MacVerifyRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::MacVerifyResponse >
virtual GenerateRandomBytes(google::cloud::kms::v1::GenerateRandomBytesRequest 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::kms::v1::GenerateRandomBytesRequest const &
Returns
Type
Description
StatusOr< google::cloud::kms::v1::GenerateRandomBytesResponse >
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-28 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-28 UTC."],[],[]]