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 2021 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// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/spanner/admin/database/v1/spanner_database_admin.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
21
22#include "google/cloud/spanner/admin/database_admin_connection.h"
23#include <gmock/gmock.h>
24
25namespace google {
26namespace cloud {
27namespace spanner_admin_mocks {
28GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
29
30/**
31 * A class to mock `DatabaseAdminConnection`.
32 *
33 * Application developers may want to test their code with simulated responses,
34 * including errors, from an object of type `DatabaseAdminClient`. To do so,
35 * construct an object of type `DatabaseAdminClient` with an instance of this
36 * class. Then use the Google Test framework functions to program the behavior
37 * of this mock.
38 *
39 * @see [This example][bq-mock] for how to test your application with GoogleTest.
40 * While the example showcases types from the BigQuery library, the underlying
41 * principles apply for any pair of `*Client` and `*Connection`.
42 *
43 * [bq-mock]: @cloud_cpp_docs_link{bigquery,bigquery-read-mock}
44 */
47 public:
48 MOCK_METHOD(Options, options, (), (override));
49
50 MOCK_METHOD(
51 StreamRange<google::spanner::admin::database::v1::Database>,
52 ListDatabases,
53 (google::spanner::admin::database::v1::ListDatabasesRequest request),
54 (override));
55
56 MOCK_METHOD(
57 future<StatusOr<google::spanner::admin::database::v1::Database>>,
58 CreateDatabase,
59 (google::spanner::admin::database::v1::CreateDatabaseRequest const&
60 request),
61 (override));
62
63 MOCK_METHOD(
64 StatusOr<google::spanner::admin::database::v1::Database>, GetDatabase,
65 (google::spanner::admin::database::v1::GetDatabaseRequest const& request),
66 (override));
67
68 MOCK_METHOD(
69 future<StatusOr<google::spanner::admin::database::v1::Database>>,
70 UpdateDatabase,
71 (google::spanner::admin::database::v1::UpdateDatabaseRequest const&
72 request),
73 (override));
74
75 MOCK_METHOD(
76 future<StatusOr<
77 google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>,
78 UpdateDatabaseDdl,
79 (google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const&
80 request),
81 (override));
82
83 MOCK_METHOD(Status, DropDatabase,
84 (google::spanner::admin::database::v1::DropDatabaseRequest const&
85 request),
86 (override));
87
88 MOCK_METHOD(
89 StatusOr<google::spanner::admin::database::v1::GetDatabaseDdlResponse>,
90 GetDatabaseDdl,
91 (google::spanner::admin::database::v1::GetDatabaseDdlRequest const&
92 request),
93 (override));
94
95 MOCK_METHOD(StatusOr<google::iam::v1::Policy>, SetIamPolicy,
96 (google::iam::v1::SetIamPolicyRequest const& request),
97 (override));
98
99 MOCK_METHOD(StatusOr<google::iam::v1::Policy>, GetIamPolicy,
100 (google::iam::v1::GetIamPolicyRequest const& request),
101 (override));
102
103 MOCK_METHOD(StatusOr<google::iam::v1::TestIamPermissionsResponse>,
104 TestIamPermissions,
105 (google::iam::v1::TestIamPermissionsRequest const& request),
106 (override));
107
108 MOCK_METHOD(future<StatusOr<google::spanner::admin::database::v1::Backup>>,
109 CreateBackup,
110 (google::spanner::admin::database::v1::CreateBackupRequest const&
111 request),
112 (override));
113
114 MOCK_METHOD(
115 future<StatusOr<google::spanner::admin::database::v1::Backup>>,
116 CopyBackup,
117 (google::spanner::admin::database::v1::CopyBackupRequest const& request),
118 (override));
119
120 MOCK_METHOD(
121 StatusOr<google::spanner::admin::database::v1::Backup>, GetBackup,
122 (google::spanner::admin::database::v1::GetBackupRequest const& request),
123 (override));
124
125 MOCK_METHOD(StatusOr<google::spanner::admin::database::v1::Backup>,
126 UpdateBackup,
127 (google::spanner::admin::database::v1::UpdateBackupRequest const&
128 request),
129 (override));
130
131 MOCK_METHOD(Status, DeleteBackup,
132 (google::spanner::admin::database::v1::DeleteBackupRequest const&
133 request),
134 (override));
135
136 MOCK_METHOD(
137 StreamRange<google::spanner::admin::database::v1::Backup>, ListBackups,
138 (google::spanner::admin::database::v1::ListBackupsRequest request),
139 (override));
140
141 MOCK_METHOD(
142 future<StatusOr<google::spanner::admin::database::v1::Database>>,
143 RestoreDatabase,
144 (google::spanner::admin::database::v1::RestoreDatabaseRequest const&
145 request),
146 (override));
147
148 MOCK_METHOD(
149 StreamRange<google::longrunning::Operation>, ListDatabaseOperations,
150 (google::spanner::admin::database::v1::ListDatabaseOperationsRequest
151 request),
152 (override));
153
154 MOCK_METHOD(StreamRange<google::longrunning::Operation>, ListBackupOperations,
155 (google::spanner::admin::database::v1::ListBackupOperationsRequest
156 request),
157 (override));
158
159 MOCK_METHOD(
160 StreamRange<google::spanner::admin::database::v1::DatabaseRole>,
161 ListDatabaseRoles,
162 (google::spanner::admin::database::v1::ListDatabaseRolesRequest request),
163 (override));
164};
165
166GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
167} // namespace spanner_admin_mocks
168} // namespace cloud
169} // namespace google
170
171#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_MOCKS_MOCK_DATABASE_ADMIN_CONNECTION_H
friend friend class future
The DatabaseAdminConnection object for DatabaseAdminClient.
Definition: database_admin_connection.h:64
A class to mock DatabaseAdminConnection.
Definition: mock_database_admin_connection.h:46
Definition: mock_database_admin_connection.h:27
Definition: database_admin_client.h:34