Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
mock_policies_connection.h
1// Copyright 2022 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/iam/v2/policy.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_MOCKS_MOCK_POLICIES_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_MOCKS_MOCK_POLICIES_CONNECTION_H
21
22#include "google/cloud/iam/v2/policies_connection.h"
23#include <gmock/gmock.h>
24
25namespace google {
26namespace cloud {
27namespace iam_v2_mocks {
28GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
29
30/**
31 * A class to mock `PoliciesConnection`.
32 *
33 * Application developers may want to test their code with simulated responses,
34 * including errors, from an object of type `PoliciesClient`. To do so,
35 * construct an object of type `PoliciesClient` 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 */
46 public:
47 MOCK_METHOD(Options, options, (), (override));
48
49 MOCK_METHOD(StreamRange<google::iam::v2::Policy>, ListPolicies,
50 (google::iam::v2::ListPoliciesRequest request), (override));
51
52 MOCK_METHOD(StatusOr<google::iam::v2::Policy>, GetPolicy,
53 (google::iam::v2::GetPolicyRequest const& request), (override));
54
55 MOCK_METHOD(future<StatusOr<google::iam::v2::Policy>>, CreatePolicy,
56 (google::iam::v2::CreatePolicyRequest const& request),
57 (override));
58
59 MOCK_METHOD(future<StatusOr<google::iam::v2::Policy>>, UpdatePolicy,
60 (google::iam::v2::UpdatePolicyRequest const& request),
61 (override));
62
63 MOCK_METHOD(future<StatusOr<google::iam::v2::Policy>>, DeletePolicy,
64 (google::iam::v2::DeletePolicyRequest const& request),
65 (override));
66};
67
68GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
69} // namespace iam_v2_mocks
70} // namespace cloud
71} // namespace google
72
73#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IAM_V2_MOCKS_MOCK_POLICIES_CONNECTION_H
friend friend class future
The PoliciesConnection object for PoliciesClient.
Definition: policies_connection.h:63
A class to mock PoliciesConnection.
Definition: mock_policies_connection.h:45
Definition: mock_policies_connection.h:27
Definition: policies_client.h:34