A class to mock ArtifactRegistryConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type ArtifactRegistryClient
. To do so, construct an object of type ArtifactRegistryClient
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 ListDockerImages(google::devtools::artifactregistry::v1::ListDockerImagesRequest)
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::devtools::artifactregistry::v1::ListDockerImagesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::DockerImage > |
|
virtual GetDockerImage(google::devtools::artifactregistry::v1::GetDockerImageRequest 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::devtools::artifactregistry::v1::GetDockerImageRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::DockerImage > |
|
virtual ListMavenArtifacts(google::devtools::artifactregistry::v1::ListMavenArtifactsRequest)
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::devtools::artifactregistry::v1::ListMavenArtifactsRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::MavenArtifact > |
|
virtual GetMavenArtifact(google::devtools::artifactregistry::v1::GetMavenArtifactRequest 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::devtools::artifactregistry::v1::GetMavenArtifactRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::MavenArtifact > |
|
virtual ListNpmPackages(google::devtools::artifactregistry::v1::ListNpmPackagesRequest)
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::devtools::artifactregistry::v1::ListNpmPackagesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::NpmPackage > |
|
virtual GetNpmPackage(google::devtools::artifactregistry::v1::GetNpmPackageRequest 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::devtools::artifactregistry::v1::GetNpmPackageRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::NpmPackage > |
|
virtual ListPythonPackages(google::devtools::artifactregistry::v1::ListPythonPackagesRequest)
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::devtools::artifactregistry::v1::ListPythonPackagesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::PythonPackage > |
|
virtual GetPythonPackage(google::devtools::artifactregistry::v1::GetPythonPackageRequest 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::devtools::artifactregistry::v1::GetPythonPackageRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::PythonPackage > |
|
virtual ImportAptArtifacts(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::devtools::artifactregistry::v1::ImportAptArtifactsResponse > > |
|
virtual ImportYumArtifacts(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::devtools::artifactregistry::v1::ImportYumArtifactsResponse > > |
|
virtual ListRepositories(google::devtools::artifactregistry::v1::ListRepositoriesRequest)
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::devtools::artifactregistry::v1::ListRepositoriesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Repository > |
|
virtual GetRepository(google::devtools::artifactregistry::v1::GetRepositoryRequest 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::devtools::artifactregistry::v1::GetRepositoryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Repository > |
|
virtual CreateRepository(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::devtools::artifactregistry::v1::Repository > > |
|
virtual UpdateRepository(google::devtools::artifactregistry::v1::UpdateRepositoryRequest 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::devtools::artifactregistry::v1::UpdateRepositoryRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Repository > |
|
virtual DeleteRepository(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::devtools::artifactregistry::v1::OperationMetadata > > |
|
virtual ListPackages(google::devtools::artifactregistry::v1::ListPackagesRequest)
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::devtools::artifactregistry::v1::ListPackagesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Package > |
|
virtual GetPackage(google::devtools::artifactregistry::v1::GetPackageRequest 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::devtools::artifactregistry::v1::GetPackageRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Package > |
|
virtual DeletePackage(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::devtools::artifactregistry::v1::OperationMetadata > > |
|
virtual ListVersions(google::devtools::artifactregistry::v1::ListVersionsRequest)
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::devtools::artifactregistry::v1::ListVersionsRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Version > |
|
virtual GetVersion(google::devtools::artifactregistry::v1::GetVersionRequest 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::devtools::artifactregistry::v1::GetVersionRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Version > |
|
virtual DeleteVersion(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::devtools::artifactregistry::v1::OperationMetadata > > |
|
virtual BatchDeleteVersions(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::devtools::artifactregistry::v1::BatchDeleteVersionsMetadata > > |
|
virtual UpdateVersion(google::devtools::artifactregistry::v1::UpdateVersionRequest 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::devtools::artifactregistry::v1::UpdateVersionRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Version > |
|
virtual ListFiles(google::devtools::artifactregistry::v1::ListFilesRequest)
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::devtools::artifactregistry::v1::ListFilesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::File > |
|
virtual GetFile(google::devtools::artifactregistry::v1::GetFileRequest 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::devtools::artifactregistry::v1::GetFileRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::File > |
|
virtual DeleteFile(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::devtools::artifactregistry::v1::OperationMetadata > > |
|
virtual UpdateFile(google::devtools::artifactregistry::v1::UpdateFileRequest 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::devtools::artifactregistry::v1::UpdateFileRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::File > |
|
virtual ListTags(google::devtools::artifactregistry::v1::ListTagsRequest)
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::devtools::artifactregistry::v1::ListTagsRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Tag > |
|
virtual GetTag(google::devtools::artifactregistry::v1::GetTagRequest 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::devtools::artifactregistry::v1::GetTagRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Tag > |
|
virtual CreateTag(google::devtools::artifactregistry::v1::CreateTagRequest 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::devtools::artifactregistry::v1::CreateTagRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Tag > |
|
virtual UpdateTag(google::devtools::artifactregistry::v1::UpdateTagRequest 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::devtools::artifactregistry::v1::UpdateTagRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Tag > |
|
virtual DeleteTag(google::devtools::artifactregistry::v1::DeleteTagRequest 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::devtools::artifactregistry::v1::DeleteTagRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual CreateRule(google::devtools::artifactregistry::v1::CreateRuleRequest 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::devtools::artifactregistry::v1::CreateRuleRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Rule > |
|
virtual ListRules(google::devtools::artifactregistry::v1::ListRulesRequest)
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::devtools::artifactregistry::v1::ListRulesRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Rule > |
|
virtual GetRule(google::devtools::artifactregistry::v1::GetRuleRequest 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::devtools::artifactregistry::v1::GetRuleRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Rule > |
|
virtual UpdateRule(google::devtools::artifactregistry::v1::UpdateRuleRequest 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::devtools::artifactregistry::v1::UpdateRuleRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Rule > |
|
virtual DeleteRule(google::devtools::artifactregistry::v1::DeleteRuleRequest 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::devtools::artifactregistry::v1::DeleteRuleRequest const &
|
Returns |
Type |
Description |
Status |
|
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 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 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 GetProjectSettings(google::devtools::artifactregistry::v1::GetProjectSettingsRequest 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::devtools::artifactregistry::v1::GetProjectSettingsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::ProjectSettings > |
|
virtual UpdateProjectSettings(google::devtools::artifactregistry::v1::UpdateProjectSettingsRequest 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::devtools::artifactregistry::v1::UpdateProjectSettingsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::ProjectSettings > |
|
virtual GetVPCSCConfig(google::devtools::artifactregistry::v1::GetVPCSCConfigRequest 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::devtools::artifactregistry::v1::GetVPCSCConfigRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::VPCSCConfig > |
|
virtual UpdateVPCSCConfig(google::devtools::artifactregistry::v1::UpdateVPCSCConfigRequest 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::devtools::artifactregistry::v1::UpdateVPCSCConfigRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::VPCSCConfig > |
|
virtual UpdatePackage(google::devtools::artifactregistry::v1::UpdatePackageRequest 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::devtools::artifactregistry::v1::UpdatePackageRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Package > |
|
virtual ListAttachments(google::devtools::artifactregistry::v1::ListAttachmentsRequest)
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::devtools::artifactregistry::v1::ListAttachmentsRequest
|
Returns |
Type |
Description |
StreamRange< google::devtools::artifactregistry::v1::Attachment > |
|
virtual GetAttachment(google::devtools::artifactregistry::v1::GetAttachmentRequest 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::devtools::artifactregistry::v1::GetAttachmentRequest const &
|
Returns |
Type |
Description |
StatusOr< google::devtools::artifactregistry::v1::Attachment > |
|
virtual CreateAttachment(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::devtools::artifactregistry::v1::Attachment > > |
|
virtual DeleteAttachment(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::devtools::artifactregistry::v1::OperationMetadata > > |
|
virtual ListLocations(google::cloud::location::ListLocationsRequest)
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::location::ListLocationsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::location::Location > |
|
virtual GetLocation(google::cloud::location::GetLocationRequest 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::location::GetLocationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::location::Location > |
|
virtual GetOperation(google::longrunning::GetOperationRequest 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::longrunning::GetOperationRequest const &
|
Returns |
Type |
Description |
StatusOr< google::longrunning::Operation > |
|