Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
mock_instance_admin_connection.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_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H
17 
18 #include "google/cloud/spanner/instance_admin_connection.h"
19 #include "google/cloud/spanner/version.h"
20 #include <gmock/gmock.h>
21 
22 namespace google {
23 namespace cloud {
24 namespace spanner_mocks {
25 inline namespace SPANNER_CLIENT_NS {
26 /**
27  * A class to mock `google::cloud::spanner::InstanceAdminConnection`.
28  *
29  * Application developers may want to test their code with simulated responses,
30  * including errors from a `spanner::InstanceAdminClient`. To do so, construct a
31  * `spanner::InstanceAdminClient` with an instance of this class. Then use the
32  * Google Test framework functions to program the behavior of this mock.
33  */
36  public:
37  MOCK_METHOD(StatusOr<google::spanner::admin::instance::v1::Instance>,
38  GetInstance, (GetInstanceParams), (override));
39  MOCK_METHOD(future<StatusOr<google::spanner::admin::instance::v1::Instance>>,
40  CreateInstance, (CreateInstanceParams), (override));
41  MOCK_METHOD(future<StatusOr<google::spanner::admin::instance::v1::Instance>>,
42  UpdateInstance, (UpdateInstanceParams), (override));
43  MOCK_METHOD(Status, DeleteInstance, (DeleteInstanceParams), (override));
44  MOCK_METHOD(StatusOr<google::spanner::admin::instance::v1::InstanceConfig>,
45  GetInstanceConfig, (GetInstanceConfigParams), (override));
46  MOCK_METHOD(spanner::ListInstanceConfigsRange, ListInstanceConfigs,
48  MOCK_METHOD(spanner::ListInstancesRange, ListInstances, (ListInstancesParams),
49  (override));
50  MOCK_METHOD(StatusOr<google::iam::v1::Policy>, GetIamPolicy,
52  MOCK_METHOD(StatusOr<google::iam::v1::Policy>, SetIamPolicy,
54  MOCK_METHOD(StatusOr<google::iam::v1::TestIamPermissionsResponse>,
55  TestIamPermissions, (TestIamPermissionsParams), (override));
56 };
57 
58 } // namespace SPANNER_CLIENT_NS
59 } // namespace spanner_mocks
60 } // namespace cloud
61 } // namespace google
62 
63 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_MOCKS_MOCK_INSTANCE_ADMIN_CONNECTION_H