Class MockDocumentProcessorServiceConnection (2.29.0)

A class to mock DocumentProcessorServiceConnection.

Application developers may want to test their code with simulated responses, including errors, from an object of type DocumentProcessorServiceClient. To do so, construct an object of type DocumentProcessorServiceClient 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 ProcessDocument(google::cloud::documentai::v1::ProcessRequest 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::documentai::v1::ProcessRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessResponse >

virtual BatchProcessDocuments(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::documentai::v1::BatchProcessResponse > >

virtual FetchProcessorTypes(google::cloud::documentai::v1::FetchProcessorTypesRequest 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::documentai::v1::FetchProcessorTypesRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::FetchProcessorTypesResponse >

virtual ListProcessorTypes(google::cloud::documentai::v1::ListProcessorTypesRequest)

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::documentai::v1::ListProcessorTypesRequest
Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorType >

virtual GetProcessorType(google::cloud::documentai::v1::GetProcessorTypeRequest 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::documentai::v1::GetProcessorTypeRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorType >

virtual ListProcessors(google::cloud::documentai::v1::ListProcessorsRequest)

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::documentai::v1::ListProcessorsRequest
Returns
Type Description
StreamRange< google::cloud::documentai::v1::Processor >

virtual GetProcessor(google::cloud::documentai::v1::GetProcessorRequest 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::documentai::v1::GetProcessorRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

virtual TrainProcessorVersion(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::documentai::v1::TrainProcessorVersionResponse > >

virtual GetProcessorVersion(google::cloud::documentai::v1::GetProcessorVersionRequest 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::documentai::v1::GetProcessorVersionRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::ProcessorVersion >

virtual ListProcessorVersions(google::cloud::documentai::v1::ListProcessorVersionsRequest)

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::documentai::v1::ListProcessorVersionsRequest
Returns
Type Description
StreamRange< google::cloud::documentai::v1::ProcessorVersion >

virtual DeleteProcessorVersion(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::documentai::v1::DeleteProcessorVersionMetadata > >

virtual DeployProcessorVersion(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::documentai::v1::DeployProcessorVersionResponse > >

virtual UndeployProcessorVersion(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::documentai::v1::UndeployProcessorVersionResponse > >

virtual CreateProcessor(google::cloud::documentai::v1::CreateProcessorRequest 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::documentai::v1::CreateProcessorRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::Processor >

virtual DeleteProcessor(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::documentai::v1::DeleteProcessorMetadata > >

virtual EnableProcessor(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::documentai::v1::EnableProcessorResponse > >

virtual DisableProcessor(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::documentai::v1::DisableProcessorResponse > >

virtual SetDefaultProcessorVersion(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::documentai::v1::SetDefaultProcessorVersionResponse > >

virtual ReviewDocument(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::documentai::v1::ReviewDocumentResponse > >

virtual EvaluateProcessorVersion(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::documentai::v1::EvaluateProcessorVersionResponse > >

virtual GetEvaluation(google::cloud::documentai::v1::GetEvaluationRequest 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::documentai::v1::GetEvaluationRequest const &
Returns
Type Description
StatusOr< google::cloud::documentai::v1::Evaluation >

virtual ListEvaluations(google::cloud::documentai::v1::ListEvaluationsRequest)

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::documentai::v1::ListEvaluationsRequest
Returns
Type Description
StreamRange< google::cloud::documentai::v1::Evaluation >