Send feedback
Class MockDataTransferServiceConnection (2.34.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.34.0 keyboard_arrow_down
A class to mock DataTransferServiceConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type DataTransferServiceClient
. To do so, construct an object of type DataTransferServiceClient
with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.
See Also
This example for how to test your application with GoogleTest. While the example showcases types from the BigQuery library, the underlying principles apply for any pair of *Client
and *Connection
.
Functions
virtual options()
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Returns
Type
Description
Options
virtual GetDataSource(google::cloud::bigquery::datatransfer::v1::GetDataSourceRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::GetDataSourceRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::DataSource >
virtual ListDataSources(google::cloud::bigquery::datatransfer::v1::ListDataSourcesRequest)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::ListDataSourcesRequest
Returns
Type
Description
StreamRange< google::cloud::bigquery::datatransfer::v1::DataSource >
virtual CreateTransferConfig(google::cloud::bigquery::datatransfer::v1::CreateTransferConfigRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::CreateTransferConfigRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::TransferConfig >
virtual UpdateTransferConfig(google::cloud::bigquery::datatransfer::v1::UpdateTransferConfigRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::UpdateTransferConfigRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::TransferConfig >
virtual DeleteTransferConfig(google::cloud::bigquery::datatransfer::v1::DeleteTransferConfigRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::DeleteTransferConfigRequest const &
Returns
Type
Description
Status
virtual GetTransferConfig(google::cloud::bigquery::datatransfer::v1::GetTransferConfigRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::GetTransferConfigRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::TransferConfig >
virtual ListTransferConfigs(google::cloud::bigquery::datatransfer::v1::ListTransferConfigsRequest)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::ListTransferConfigsRequest
Returns
Type
Description
StreamRange< google::cloud::bigquery::datatransfer::v1::TransferConfig >
virtual ScheduleTransferRuns(google::cloud::bigquery::datatransfer::v1::ScheduleTransferRunsRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::ScheduleTransferRunsRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::ScheduleTransferRunsResponse >
virtual StartManualTransferRuns(google::cloud::bigquery::datatransfer::v1::StartManualTransferRunsRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::StartManualTransferRunsRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::StartManualTransferRunsResponse >
virtual GetTransferRun(google::cloud::bigquery::datatransfer::v1::GetTransferRunRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::GetTransferRunRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::TransferRun >
virtual DeleteTransferRun(google::cloud::bigquery::datatransfer::v1::DeleteTransferRunRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::DeleteTransferRunRequest const &
Returns
Type
Description
Status
virtual ListTransferRuns(google::cloud::bigquery::datatransfer::v1::ListTransferRunsRequest)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::ListTransferRunsRequest
Returns
Type
Description
StreamRange< google::cloud::bigquery::datatransfer::v1::TransferRun >
virtual ListTransferLogs(google::cloud::bigquery::datatransfer::v1::ListTransferLogsRequest)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::ListTransferLogsRequest
Returns
Type
Description
StreamRange< google::cloud::bigquery::datatransfer::v1::TransferMessage >
virtual CheckValidCreds(google::cloud::bigquery::datatransfer::v1::CheckValidCredsRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::CheckValidCredsRequest const &
Returns
Type
Description
StatusOr< google::cloud::bigquery::datatransfer::v1::CheckValidCredsResponse >
virtual EnrollDataSources(google::cloud::bigquery::datatransfer::v1::EnrollDataSourcesRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::EnrollDataSourcesRequest const &
Returns
Type
Description
Status
virtual UnenrollDataSources(google::cloud::bigquery::datatransfer::v1::UnenrollDataSourcesRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::bigquery::datatransfer::v1::UnenrollDataSourcesRequest const &
Returns
Type
Description
Status
virtual ListLocations(google::cloud::location::ListLocationsRequest)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::location::ListLocationsRequest
Returns
Type
Description
StreamRange< google::cloud::location::Location >
virtual GetLocation(google::cloud::location::GetLocationRequest const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
request
google::cloud::location::GetLocationRequest const &
Returns
Type
Description
StatusOr< google::cloud::location::Location >
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-14 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-14 UTC."],[[["This document outlines the `MockDataTransferServiceConnection` class, which is designed for mocking the `DataTransferServiceConnection` in testing scenarios."],["The class enables developers to test their code with simulated responses and errors using the `DataTransferServiceClient`, and it works through the Google Test framework."],["It provides virtual functions like `options()`, `GetDataSource()`, and `CreateTransferConfig()`, among others, all of which are implemented using gMock's `MOCK_METHOD()` for flexible mocking."],["The documentation shows that the latest version available is 2.37.0-rc, with a list of previous versions dating back to 2.11.0 available."],["The documentation references an example in the BigQuery library to showcase how the testing principles can be applied with `*Client` and `*Connection` pairs."]]],[]]