A class to mock StorageTransferServiceConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type StorageTransferServiceClient
. To do so, construct an object of type StorageTransferServiceClient
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 GetGoogleServiceAccount(google::storagetransfer::v1::GetGoogleServiceAccountRequest 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::storagetransfer::v1::GetGoogleServiceAccountRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::GoogleServiceAccount > |
|
virtual CreateTransferJob(google::storagetransfer::v1::CreateTransferJobRequest 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::storagetransfer::v1::CreateTransferJobRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::TransferJob > |
|
virtual UpdateTransferJob(google::storagetransfer::v1::UpdateTransferJobRequest 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::storagetransfer::v1::UpdateTransferJobRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::TransferJob > |
|
virtual GetTransferJob(google::storagetransfer::v1::GetTransferJobRequest 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::storagetransfer::v1::GetTransferJobRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::TransferJob > |
|
virtual ListTransferJobs(google::storagetransfer::v1::ListTransferJobsRequest)
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::storagetransfer::v1::ListTransferJobsRequest
|
Returns |
Type |
Description |
StreamRange< google::storagetransfer::v1::TransferJob > |
|
virtual PauseTransferOperation(google::storagetransfer::v1::PauseTransferOperationRequest 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::storagetransfer::v1::PauseTransferOperationRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual ResumeTransferOperation(google::storagetransfer::v1::ResumeTransferOperationRequest 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::storagetransfer::v1::ResumeTransferOperationRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual RunTransferJob(google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameter |
Name |
Description |
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::storagetransfer::v1::TransferOperation > > |
|
virtual DeleteTransferJob(google::storagetransfer::v1::DeleteTransferJobRequest 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::storagetransfer::v1::DeleteTransferJobRequest const &
|
Returns |
Type |
Description |
Status |
|
virtual CreateAgentPool(google::storagetransfer::v1::CreateAgentPoolRequest 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::storagetransfer::v1::CreateAgentPoolRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::AgentPool > |
|
virtual UpdateAgentPool(google::storagetransfer::v1::UpdateAgentPoolRequest 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::storagetransfer::v1::UpdateAgentPoolRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::AgentPool > |
|
virtual GetAgentPool(google::storagetransfer::v1::GetAgentPoolRequest 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::storagetransfer::v1::GetAgentPoolRequest const &
|
Returns |
Type |
Description |
StatusOr< google::storagetransfer::v1::AgentPool > |
|
virtual ListAgentPools(google::storagetransfer::v1::ListAgentPoolsRequest)
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::storagetransfer::v1::ListAgentPoolsRequest
|
Returns |
Type |
Description |
StreamRange< google::storagetransfer::v1::AgentPool > |
|
virtual DeleteAgentPool(google::storagetransfer::v1::DeleteAgentPoolRequest 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::storagetransfer::v1::DeleteAgentPoolRequest const &
|
Returns |
Type |
Description |
Status |
|