Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
mock_instance_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_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
22namespace google {
23namespace cloud {
24namespace spanner_mocks {
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
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
58GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
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
friend friend class future
A connection to the Cloud Spanner instance administration service.
Definition: instance_admin_connection.h:75
A class to mock google::cloud::spanner::InstanceAdminConnection.
Definition: mock_instance_admin_connection.h:35
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 CreateInstance().
Definition: instance_admin_connection.h:97
Wrap the arguments for DeleteInstance().
Definition: instance_admin_connection.h:107
Wrap the arguments for GetIamPolicy().
Definition: instance_admin_connection.h:146
Wrap the arguments for GetInstanceConfig().
Definition: instance_admin_connection.h:112
Wrap the arguments for GetInstance().
Definition: instance_admin_connection.h:90
Wrap the arguments for ListInstanceConfigs().
Definition: instance_admin_connection.h:117
Wrap the arguments for ListInstances().
Definition: instance_admin_connection.h:124
Wrap the arguments for SetIamPolicy().
Definition: instance_admin_connection.h:151
Wrap the arguments for TestIamPermissions().
Definition: instance_admin_connection.h:157
Wrap the arguments for UpdateInstance().
Definition: instance_admin_connection.h:102