Google Cloud BigQuery C++ Client 2.11.0
A C++ Client Library for Google Cloud BigQuery
Loading...
Searching...
No Matches
mock_job_connection.h
1// Copyright 2023 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_BIGQUERY_V2_MINIMAL_MOCKS_MOCK_JOB_CONNECTION_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_MOCKS_MOCK_JOB_CONNECTION_H
17
18#include "google/cloud/bigquery/v2/minimal/internal/job_connection.h"
19#include <gmock/gmock.h>
20
21namespace google {
22namespace cloud {
24GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
25
26/*
27 * A class to mock `BigQueryJobConnection`.
28 *
29 * Application developers may want to test their code with simulated responses,
30 * including errors, from an object of type `BigQueryJobClient`. To do so,
31 * construct an object of type `BigQueryJobClient` with an instance of this
32 * class. Then use the Google Test framework functions to program the behavior
33 * of this mock.
34 */
35// TODO(#11039): Move to "bigquery_v2_minimal_mocks" namespace when api is ready
36// to go public.
37class MockBigQueryJobConnection : public BigQueryJobConnection {
38 public:
39 MOCK_METHOD(Options, options, (), (override));
40
41 MOCK_METHOD(StatusOr<Job>, GetJob, (GetJobRequest const& request),
42 (override));
43
44 MOCK_METHOD(StreamRange<ListFormatJob>, ListJobs,
45 (ListJobsRequest const& request), (override));
46};
47
48GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
49} // namespace bigquery_v2_minimal_internal
50} // namespace cloud
51} // namespace google
52
53#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_V2_MINIMAL_MOCKS_MOCK_JOB_CONNECTION_H
Definition: mock_dataset_connection.h:23