Class MockReservationsConnection (2.26.0-rc)

A class to mock ReservationsConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type ReservationsClient. To do so, construct an object of type ReservationsClient 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 AggregatedListReservations(google::cloud::cpp::compute::reservations::v1::AggregatedListReservationsRequest)

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::cloud::cpp::compute::reservations::v1::AggregatedListReservationsRequest
Returns
Type Description
StreamRange< std::pair< std::string, google::cloud::cpp::compute::v1::ReservationsScopedList > >

virtual DeleteReservation(google::cloud::cpp::compute::reservations::v1::DeleteReservationRequest 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::cloud::cpp::compute::reservations::v1::DeleteReservationRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual GetReservation(google::cloud::cpp::compute::reservations::v1::GetReservationRequest 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::cloud::cpp::compute::reservations::v1::GetReservationRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Reservation >

virtual GetIamPolicy(google::cloud::cpp::compute::reservations::v1::GetIamPolicyRequest 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::cloud::cpp::compute::reservations::v1::GetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Policy >

virtual InsertReservation(google::cloud::cpp::compute::reservations::v1::InsertReservationRequest 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::cloud::cpp::compute::reservations::v1::InsertReservationRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual ListReservations(google::cloud::cpp::compute::reservations::v1::ListReservationsRequest)

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::cloud::cpp::compute::reservations::v1::ListReservationsRequest
Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::Reservation >

virtual Resize(google::cloud::cpp::compute::reservations::v1::ResizeRequest 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::cloud::cpp::compute::reservations::v1::ResizeRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

virtual SetIamPolicy(google::cloud::cpp::compute::reservations::v1::SetIamPolicyRequest 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::cloud::cpp::compute::reservations::v1::SetIamPolicyRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Policy >

virtual TestIamPermissions(google::cloud::cpp::compute::reservations::v1::TestIamPermissionsRequest 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::cloud::cpp::compute::reservations::v1::TestIamPermissionsRequest const &
Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::TestPermissionsResponse >

virtual UpdateReservation(google::cloud::cpp::compute::reservations::v1::UpdateReservationRequest 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::cloud::cpp::compute::reservations::v1::UpdateReservationRequest const &
Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >