A class to mock NotebookServiceConnection
.
Application developers may want to test their code with simulated responses, including errors, from an object of type NotebookServiceClient
. To do so, construct an object of type NotebookServiceClient
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 ListInstances(google::cloud::notebooks::v1::ListInstancesRequest)
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::notebooks::v1::ListInstancesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::notebooks::v1::Instance > |
|
virtual GetInstance(google::cloud::notebooks::v1::GetInstanceRequest 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::notebooks::v1::GetInstanceRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::Instance > |
|
virtual CreateInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual RegisterInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual SetInstanceAccelerator(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual SetInstanceMachineType(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual UpdateInstanceConfig(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual UpdateShieldedInstanceConfig(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual SetInstanceLabels(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual UpdateInstanceMetadataItems(google::cloud::notebooks::v1::UpdateInstanceMetadataItemsRequest 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::notebooks::v1::UpdateInstanceMetadataItemsRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::UpdateInstanceMetadataItemsResponse > |
|
virtual DeleteInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::OperationMetadata > > |
|
virtual StartInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual StopInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual ResetInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual ReportInstanceInfo(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual IsInstanceUpgradeable(google::cloud::notebooks::v1::IsInstanceUpgradeableRequest 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::notebooks::v1::IsInstanceUpgradeableRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::IsInstanceUpgradeableResponse > |
|
virtual GetInstanceHealth(google::cloud::notebooks::v1::GetInstanceHealthRequest 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::notebooks::v1::GetInstanceHealthRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::GetInstanceHealthResponse > |
|
virtual UpgradeInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual RollbackInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual DiagnoseInstance(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual UpgradeInstanceInternal(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Instance > > |
|
virtual ListEnvironments(google::cloud::notebooks::v1::ListEnvironmentsRequest)
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::notebooks::v1::ListEnvironmentsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::notebooks::v1::Environment > |
|
virtual GetEnvironment(google::cloud::notebooks::v1::GetEnvironmentRequest 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::notebooks::v1::GetEnvironmentRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::Environment > |
|
virtual CreateEnvironment(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Environment > > |
|
virtual DeleteEnvironment(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::OperationMetadata > > |
|
virtual ListSchedules(google::cloud::notebooks::v1::ListSchedulesRequest)
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::notebooks::v1::ListSchedulesRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::notebooks::v1::Schedule > |
|
virtual GetSchedule(google::cloud::notebooks::v1::GetScheduleRequest 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::notebooks::v1::GetScheduleRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::Schedule > |
|
virtual DeleteSchedule(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::OperationMetadata > > |
|
virtual CreateSchedule(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Schedule > > |
|
virtual TriggerSchedule(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Schedule > > |
|
virtual ListExecutions(google::cloud::notebooks::v1::ListExecutionsRequest)
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::notebooks::v1::ListExecutionsRequest
|
Returns |
Type |
Description |
StreamRange< google::cloud::notebooks::v1::Execution > |
|
virtual GetExecution(google::cloud::notebooks::v1::GetExecutionRequest 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::notebooks::v1::GetExecutionRequest const &
|
Returns |
Type |
Description |
StatusOr< google::cloud::notebooks::v1::Execution > |
|
virtual DeleteExecution(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::OperationMetadata > > |
|
virtual CreateExecution(ExperimentalTag, google::longrunning::Operation const &)
This function is implemented using gMock's MOCK_METHOD()
.
Consult the gMock documentation to use this mock in your tests.
Parameters |
Name |
Description |
|
ExperimentalTag
|
operation |
google::longrunning::Operation const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::notebooks::v1::Execution > > |
|