Class MockCloudBuildConnection (2.34.0-rc)

A class to mock CloudBuildConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type CloudBuildClient. To do so, construct an object of type CloudBuildClient 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 CreateBuild(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::devtools::cloudbuild::v1::Build > >

virtual GetBuild(google::devtools::cloudbuild::v1::GetBuildRequest 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::devtools::cloudbuild::v1::GetBuildRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

virtual ListBuilds(google::devtools::cloudbuild::v1::ListBuildsRequest)

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::devtools::cloudbuild::v1::ListBuildsRequest
Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::Build >

virtual CancelBuild(google::devtools::cloudbuild::v1::CancelBuildRequest 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::devtools::cloudbuild::v1::CancelBuildRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

virtual RetryBuild(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::devtools::cloudbuild::v1::Build > >

virtual ApproveBuild(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::devtools::cloudbuild::v1::Build > >

virtual CreateBuildTrigger(google::devtools::cloudbuild::v1::CreateBuildTriggerRequest 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::devtools::cloudbuild::v1::CreateBuildTriggerRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

virtual GetBuildTrigger(google::devtools::cloudbuild::v1::GetBuildTriggerRequest 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::devtools::cloudbuild::v1::GetBuildTriggerRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

virtual ListBuildTriggers(google::devtools::cloudbuild::v1::ListBuildTriggersRequest)

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::devtools::cloudbuild::v1::ListBuildTriggersRequest
Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::BuildTrigger >

virtual DeleteBuildTrigger(google::devtools::cloudbuild::v1::DeleteBuildTriggerRequest 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::devtools::cloudbuild::v1::DeleteBuildTriggerRequest const &
Returns
Type Description
Status

virtual UpdateBuildTrigger(google::devtools::cloudbuild::v1::UpdateBuildTriggerRequest 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::devtools::cloudbuild::v1::UpdateBuildTriggerRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

virtual RunBuildTrigger(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::devtools::cloudbuild::v1::Build > >

virtual ReceiveTriggerWebhook(google::devtools::cloudbuild::v1::ReceiveTriggerWebhookRequest 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::devtools::cloudbuild::v1::ReceiveTriggerWebhookRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::ReceiveTriggerWebhookResponse >

virtual CreateWorkerPool(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::devtools::cloudbuild::v1::WorkerPool > >

virtual GetWorkerPool(google::devtools::cloudbuild::v1::GetWorkerPoolRequest 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::devtools::cloudbuild::v1::GetWorkerPoolRequest const &
Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::WorkerPool >

virtual DeleteWorkerPool(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::devtools::cloudbuild::v1::DeleteWorkerPoolOperationMetadata > >

virtual UpdateWorkerPool(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::devtools::cloudbuild::v1::WorkerPool > >

virtual ListWorkerPools(google::devtools::cloudbuild::v1::ListWorkerPoolsRequest)

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::devtools::cloudbuild::v1::ListWorkerPoolsRequest
Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::WorkerPool >