Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
mock_database_admin_connection.h
1// Copyright 2019 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
17
18#include "google/cloud/spanner/database_admin_connection.h"
19#include "google/cloud/spanner/version.h"
20#include <gmock/gmock.h>
21
22namespace google {
23namespace cloud {
24namespace spanner_mocks {
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
26
27/**
28 * A class to mock `google::cloud::spanner::DatabaseAdminConnection`.
29 *
30 * Application developers may want to test their code with simulated responses,
31 * including errors from a `spanner::DatabaseAdminClient`. To do so, construct a
32 * `spanner::DatabaseAdminClient` with an instance of this class. Then use the
33 * Google Test framework functions to program the behavior of this mock.
34 */
37 public:
38 MOCK_METHOD(future<StatusOr<google::spanner::admin::database::v1::Database>>,
39 CreateDatabase, (CreateDatabaseParams), (override));
40 MOCK_METHOD(StatusOr<google::spanner::admin::database::v1::Database>,
41 GetDatabase, (GetDatabaseParams), (override));
42 MOCK_METHOD(
43 StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>,
44 GetDatabaseDdl, (GetDatabaseDdlParams), (override));
45 MOCK_METHOD(
46 future<StatusOr<
47 google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>,
48 UpdateDatabase, (UpdateDatabaseParams), (override));
49 MOCK_METHOD(Status, DropDatabase, (DropDatabaseParams), (override));
50 MOCK_METHOD(spanner::ListDatabaseRange, ListDatabases, (ListDatabasesParams),
51 (override));
52 MOCK_METHOD(future<StatusOr<google::spanner::admin::database::v1::Database>>,
53 RestoreDatabase, (RestoreDatabaseParams), (override));
54 MOCK_METHOD(StatusOr<google::iam::v1::Policy>, GetIamPolicy,
56 MOCK_METHOD(StatusOr<google::iam::v1::Policy>, SetIamPolicy,
58 MOCK_METHOD(StatusOr<google::iam::v1::TestIamPermissionsResponse>,
59 TestIamPermissions, (TestIamPermissionsParams), (override));
60 MOCK_METHOD(future<StatusOr<google::spanner::admin::database::v1::Backup>>,
61 CreateBackup, (CreateBackupParams), (override));
62 MOCK_METHOD(StatusOr<google::spanner::admin::database::v1::Backup>, GetBackup,
64 MOCK_METHOD(Status, DeleteBackup, (DeleteBackupParams), (override));
65 MOCK_METHOD(spanner::ListBackupsRange, ListBackups, (ListBackupsParams),
66 (override));
67 MOCK_METHOD(StatusOr<google::spanner::admin::database::v1::Backup>,
68 UpdateBackup, (UpdateBackupParams), (override));
69 MOCK_METHOD(spanner::ListBackupOperationsRange, ListBackupOperations,
71 MOCK_METHOD(spanner::ListDatabaseOperationsRange, ListDatabaseOperations,
73};
74
75GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
76} // namespace spanner_mocks
77} // namespace cloud
78} // namespace google
79
80#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
friend friend class future
A connection to the Cloud Spanner instance administration service.
Definition: database_admin_connection.h:105
A class to mock google::cloud::spanner::DatabaseAdminConnection.
Definition: mock_database_admin_connection.h:36
Define classes to mock the Cloud Spanner C++ client APIs.
Definition: mock_database_admin_connection.h:24
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23
Wrap the arguments for CreateBackup().
Definition: database_admin_connection.h:181
Wrap the arguments for CreateDatabase().
Definition: database_admin_connection.h:119
Wrap the arguments for DeleteBackup().
Definition: database_admin_connection.h:205
Wrap the arguments for DropDatabase().
Definition: database_admin_connection.h:149
Wrap the arguments for GetBackup().
Definition: database_admin_connection.h:199
Wrap the arguments for GetDatabaseDdl().
Definition: database_admin_connection.h:135
Wrap the arguments for GetDatabase().
Definition: database_admin_connection.h:129
Wrap the arguments for GetIamPolicy().
Definition: database_admin_connection.h:161
Wrap the arguments for ListBackupOperations().
Definition: database_admin_connection.h:233
Wrap the arguments for ListBackups().
Definition: database_admin_connection.h:211
Wrap the arguments for ListDatabaseOperations().
Definition: database_admin_connection.h:240
Wrap the arguments for ListDatabases().
Definition: database_admin_connection.h:155
Wrap the arguments for RestoreDatabase().
Definition: database_admin_connection.h:218
Wrap the arguments for SetIamPolicy().
Definition: database_admin_connection.h:167
Wrap the arguments for TestIamPermissions().
Definition: database_admin_connection.h:174
Wrap the arguments for UpdateBackup().
Definition: database_admin_connection.h:228
Wrap the arguments for UpdateDatabase().
Definition: database_admin_connection.h:141