Class MockCloudBuildConnection (2.21.0)

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
TypeDescription
Options

virtual CreateBuild(google::devtools::cloudbuild::v1::CreateBuildRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::CreateBuildRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::GetBuildRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::ListBuildsRequest
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::CancelBuildRequest const &
Returns
TypeDescription
StatusOr< google::devtools::cloudbuild::v1::Build >

virtual RetryBuild(google::devtools::cloudbuild::v1::RetryBuildRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::RetryBuildRequest const &
Returns
TypeDescription
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

virtual ApproveBuild(google::devtools::cloudbuild::v1::ApproveBuildRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::ApproveBuildRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::CreateBuildTriggerRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::GetBuildTriggerRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::ListBuildTriggersRequest
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::DeleteBuildTriggerRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::UpdateBuildTriggerRequest const &
Returns
TypeDescription
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

virtual RunBuildTrigger(google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::ReceiveTriggerWebhookRequest const &
Returns
TypeDescription
StatusOr< google::devtools::cloudbuild::v1::ReceiveTriggerWebhookResponse >

virtual CreateWorkerPool(google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::GetWorkerPoolRequest const &
Returns
TypeDescription
StatusOr< google::devtools::cloudbuild::v1::WorkerPool >

virtual DeleteWorkerPool(google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &
Returns
TypeDescription
future< StatusOr< google::devtools::cloudbuild::v1::DeleteWorkerPoolOperationMetadata > >

virtual UpdateWorkerPool(google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &)

This function is implemented using gMock's MOCK_METHOD(). Consult the gMock documentation to use this mock in your tests.

Parameter
NameDescription
request google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &
Returns
TypeDescription
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
NameDescription
request google::devtools::cloudbuild::v1::ListWorkerPoolsRequest
Returns
TypeDescription
StreamRange< google::devtools::cloudbuild::v1::WorkerPool >