Google Cloud Spanner C++ Client  1.32.0
A C++ Client Library for Google Cloud Spanner
Public Member Functions | List of all members
google::cloud::spanner_mocks::v1::MockConnection Class Reference

A class to mock google::cloud::spanner::Connection. More...

#include <google/cloud/spanner/mocks/mock_spanner_connection.h>

Public Member Functions

 MOCK_METHOD (spanner::RowStream, Read,(ReadParams),(override))
 
 MOCK_METHOD (StatusOr< std::vector< spanner::ReadPartition >>, PartitionRead,(PartitionReadParams),(override))
 
 MOCK_METHOD (spanner::RowStream, ExecuteQuery,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::DmlResult >, ExecuteDml,(SqlParams),(override))
 
 MOCK_METHOD (spanner::ProfileQueryResult, ProfileQuery,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::ProfileDmlResult >, ProfileDml,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::ExecutionPlan >, AnalyzeSql,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::PartitionedDmlResult >, ExecutePartitionedDml,(ExecutePartitionedDmlParams),(override))
 
 MOCK_METHOD (StatusOr< std::vector< spanner::QueryPartition >>, PartitionQuery,(PartitionQueryParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::BatchDmlResult >, ExecuteBatchDml,(ExecuteBatchDmlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::CommitResult >, Commit,(CommitParams),(override))
 
 MOCK_METHOD (Status, Rollback,(RollbackParams),(override))
 

Detailed Description

A class to mock google::cloud::spanner::Connection.

Application developers may want to test their code with simulated responses, including errors from a spanner::Client. To do so, construct a spanner::Client with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

See also
Mocking the Cloud Spanner C++ Client with Google Mock for an example using this class.

Definition at line 43 of file mock_spanner_connection.h.

Member Function Documentation

◆ MOCK_METHOD() [1/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( spanner::ProfileQueryResult  ,
ProfileQuery  ,
(SqlParams)  ,
(override)   
)

◆ MOCK_METHOD() [2/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( spanner::RowStream  ,
ExecuteQuery  ,
(SqlParams)  ,
(override)   
)

◆ MOCK_METHOD() [3/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( spanner::RowStream  ,
Read  ,
(ReadParams)  ,
(override)   
)

◆ MOCK_METHOD() [4/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( Status  ,
Rollback  ,
(RollbackParams)  ,
(override)   
)

◆ MOCK_METHOD() [5/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::BatchDmlResult ,
ExecuteBatchDml  ,
(ExecuteBatchDmlParams)  ,
(override)   
)

◆ MOCK_METHOD() [6/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::CommitResult ,
Commit  ,
(CommitParams)  ,
(override)   
)

◆ MOCK_METHOD() [7/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::DmlResult ,
ExecuteDml  ,
(SqlParams)  ,
(override)   
)

◆ MOCK_METHOD() [8/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::ExecutionPlan ,
AnalyzeSql  ,
(SqlParams)  ,
(override)   
)

◆ MOCK_METHOD() [9/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::PartitionedDmlResult ,
ExecutePartitionedDml  ,
(ExecutePartitionedDmlParams)  ,
(override)   
)

◆ MOCK_METHOD() [10/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< spanner::ProfileDmlResult ,
ProfileDml  ,
(SqlParams)  ,
(override)   
)

◆ MOCK_METHOD() [11/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< std::vector< spanner::QueryPartition >>  ,
PartitionQuery  ,
(PartitionQueryParams)  ,
(override)   
)

◆ MOCK_METHOD() [12/12]

google::cloud::spanner_mocks::v1::MockConnection::MOCK_METHOD ( StatusOr< std::vector< spanner::ReadPartition >>  ,
PartitionRead  ,
(PartitionReadParams)  ,
(override)   
)