Some or all of the information on this page might not apply to Trusted Cloud by S3NS.
Class MockDataConnection (2.21.0)
Note: Some or all of the information on this page might not apply
to Trusted Cloud. For a list of services that are available in
Trusted Cloud, see Services available for
Trusted Cloud .
Version 2.21.0keyboard_arrow_down
Constructors
MockDataConnection()
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 Apply(std::string const &, SingleRowMutation)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
mut
SingleRowMutation
Returns
Type
Description
Status
virtual AsyncApply(std::string const &, SingleRowMutation)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
mut
SingleRowMutation
Returns
Type
Description
future< Status >
virtual BulkApply(std::string const &, BulkMutation)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
mut
BulkMutation
Returns
Type
Description
std::vector< FailedMutation >
virtual AsyncBulkApply(std::string const &, BulkMutation)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
mut
BulkMutation
Returns
Type
Description
future< std::vector< FailedMutation > >
virtual ReadRows(std::string const &, RowSet, std::int64_t, Filter)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
row_set
RowSet
rows_limit
std::int64_t
filter
Filter
Returns
Type
Description
RowReader
virtual ReadRowsFull(ReadRowsParams)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
params
ReadRowsParams
Returns
Type
Description
RowReader
virtual ReadRow(std::string const &, std::string, Filter)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
row_key
std::string
filter
Filter
Returns
Type
Description
StatusOr< std::pair< bool, Row > >
virtual CheckAndMutateRow(std::string const &, std::string, Filter, std::vector< Mutation >, std::vector< Mutation >)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
row_key
std::string
filter
Filter
true_mutations
std::vector< Mutation >
false_mutations
std::vector< Mutation >
Returns
Type
Description
StatusOr< MutationBranch >
virtual AsyncCheckAndMutateRow(std::string const &, std::string, Filter, std::vector< Mutation >, std::vector< Mutation >)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
row_key
std::string
filter
Filter
true_mutations
std::vector< Mutation >
false_mutations
std::vector< Mutation >
Returns
Type
Description
future< StatusOr< MutationBranch > >
virtual SampleRows(std::string const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
table_name
std::string const &
Returns
Type
Description
StatusOr< std::vector< RowKeySample > >
virtual AsyncSampleRows(std::string const &)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter
Name
Description
table_name
std::string const &
Returns
Type
Description
future< StatusOr< std::vector< RowKeySample > > >
virtual ReadModifyWriteRow(google::bigtable::v2::ReadModifyWriteRowRequest)
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::bigtable::v2::ReadModifyWriteRowRequest
Returns
Type
Description
StatusOr< Row >
virtual AsyncReadModifyWriteRow(google::bigtable::v2::ReadModifyWriteRowRequest)
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::bigtable::v2::ReadModifyWriteRowRequest
Returns
Type
Description
future< StatusOr< Row > >
virtual AsyncReadRows(std::string const &, std::function< future< bool >(Row)>, std::function< void(Status)>, RowSet, std::int64_t, Filter)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
on_row
std::function< future< bool >(Row)>
on_finish
std::function< void(Status)>
row_set
RowSet
rows_limit
std::int64_t
filter
Filter
Returns
Type
Description
void
virtual AsyncReadRow(std::string const &, std::string, Filter)
This function is implemented using gMock 's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters
Name
Description
table_name
std::string const &
row_key
std::string
filter
Filter
Returns
Type
Description
future< StatusOr< std::pair< bool, Row > > >
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-07-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["This document outlines the `MockDataConnection` class, which is designed to simulate the behavior of `google::cloud::bigtable::DataConnection` for testing purposes."],["The `MockDataConnection` class facilitates testing by allowing developers to mock responses and errors from `bigtable::Table` using the Google Test framework and `MOCK_METHOD()`."],["The document details the various functions of `MockDataConnection`, such as `Apply`, `BulkApply`, `ReadRows`, `ReadRow`, and others, which can be used to program mock behaviors."],["The latest version available is `2.37.0-rc`, and there are several previous versions available, all the way down to `2.11.0`, providing access to these functions."],["There is a section, \"Mocking the Cloud Bigtable C++ Client with Google Mock\", that provides a comprehensive example on mocking `Table` calls."]]],[]]