Google Cloud Spanner C++ Client
A C++ Client Library for Google Cloud Spanner
mock_database_admin_stub.h
Go to the documentation of this file.
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 // http://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_SPANNER_GOOGLE_CLOUD_SPANNER_TESTING_MOCK_DATABASE_ADMIN_STUB_H_
16 #define GOOGLE_CLOUD_CPP_SPANNER_GOOGLE_CLOUD_SPANNER_TESTING_MOCK_DATABASE_ADMIN_STUB_H_
17 
18 #include "google/cloud/spanner/internal/database_admin_stub.h"
20 #include <gmock/gmock.h>
21 
22 namespace google {
23 namespace cloud {
24 namespace spanner_testing {
25 inline namespace SPANNER_CLIENT_NS {
26 
28  : public google::cloud::spanner::internal::DatabaseAdminStub {
29  public:
30  MOCK_METHOD2(
31  CreateDatabase,
32  StatusOr<google::longrunning::Operation>(
33  grpc::ClientContext&,
34  google::spanner::admin::database::v1::CreateDatabaseRequest const&));
35 
36  MOCK_METHOD2(
37  GetDatabase,
38  StatusOr<google::spanner::admin::database::v1::Database>(
39  grpc::ClientContext&,
40  google::spanner::admin::database::v1::GetDatabaseRequest const&));
41 
42  MOCK_METHOD1(AwaitCreateDatabase,
43  future<StatusOr<google::spanner::admin::database::v1::Database>>(
44  google::longrunning::Operation));
45 
46  MOCK_METHOD2(UpdateDatabase,
47  StatusOr<google::longrunning::Operation>(
48  grpc::ClientContext&, google::spanner::admin::database::v1::
49  UpdateDatabaseDdlRequest const&));
50 
51  MOCK_METHOD1(
52  AwaitUpdateDatabase,
53  future<StatusOr<
54  google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>(
55  google::longrunning::Operation));
56 
57  MOCK_METHOD2(
58  DropDatabase,
59  Status(grpc::ClientContext&,
60  google::spanner::admin::database::v1::DropDatabaseRequest const&));
61 
62  MOCK_METHOD2(
63  ListDatabases,
64  StatusOr<google::spanner::admin::database::v1::ListDatabasesResponse>(
65  grpc::ClientContext&,
66  google::spanner::admin::database::v1::ListDatabasesRequest const&));
67 
68  MOCK_METHOD2(GetOperation,
69  StatusOr<google::longrunning::Operation>(
70  grpc::ClientContext&,
71  google::longrunning::GetOperationRequest const&));
72 };
73 
74 } // namespace SPANNER_CLIENT_NS
75 } // namespace spanner_testing
76 } // namespace cloud
77 } // namespace google
78 
79 #endif // GOOGLE_CLOUD_CPP_SPANNER_GOOGLE_CLOUD_SPANNER_TESTING_MOCK_DATABASE_ADMIN_STUB_H_
#define SPANNER_CLIENT_NS
Definition: version.h:22