Class MockAutoMlConnection (2.32.0-rc)

A class to mock AutoMlConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type AutoMlClient. To do so, construct an object of type AutoMlClient 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 CreateDataset(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::cloud::automl::v1::Dataset > >

virtual GetDataset(google::cloud::automl::v1::GetDatasetRequest 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::automl::v1::GetDatasetRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::Dataset >

virtual ListDatasets(google::cloud::automl::v1::ListDatasetsRequest)

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::automl::v1::ListDatasetsRequest
Returns
Type Description
StreamRange< google::cloud::automl::v1::Dataset >

virtual UpdateDataset(google::cloud::automl::v1::UpdateDatasetRequest 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::automl::v1::UpdateDatasetRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::Dataset >

virtual DeleteDataset(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::cloud::automl::v1::OperationMetadata > >

virtual ImportData(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::cloud::automl::v1::OperationMetadata > >

virtual ExportData(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::cloud::automl::v1::OperationMetadata > >

virtual GetAnnotationSpec(google::cloud::automl::v1::GetAnnotationSpecRequest 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::automl::v1::GetAnnotationSpecRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::AnnotationSpec >

virtual CreateModel(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::cloud::automl::v1::Model > >

virtual GetModel(google::cloud::automl::v1::GetModelRequest 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::automl::v1::GetModelRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::Model >

virtual ListModels(google::cloud::automl::v1::ListModelsRequest)

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::automl::v1::ListModelsRequest
Returns
Type Description
StreamRange< google::cloud::automl::v1::Model >

virtual DeleteModel(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::cloud::automl::v1::OperationMetadata > >

virtual UpdateModel(google::cloud::automl::v1::UpdateModelRequest 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::automl::v1::UpdateModelRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::Model >

virtual DeployModel(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::cloud::automl::v1::OperationMetadata > >

virtual UndeployModel(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::cloud::automl::v1::OperationMetadata > >

virtual ExportModel(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::cloud::automl::v1::OperationMetadata > >

virtual GetModelEvaluation(google::cloud::automl::v1::GetModelEvaluationRequest 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::automl::v1::GetModelEvaluationRequest const &
Returns
Type Description
StatusOr< google::cloud::automl::v1::ModelEvaluation >

virtual ListModelEvaluations(google::cloud::automl::v1::ListModelEvaluationsRequest)

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::automl::v1::ListModelEvaluationsRequest
Returns
Type Description
StreamRange< google::cloud::automl::v1::ModelEvaluation >