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::cloud::documentai::v1::BatchProcessRequest 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::BatchProcessRequest 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::cloud::documentai::v1::TrainProcessorVersionRequest 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::TrainProcessorVersionRequest 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::cloud::documentai::v1::DeleteProcessorVersionRequest 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::DeleteProcessorVersionRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorVersionMetadata > > |
|
virtual DeployProcessorVersion(google::cloud::documentai::v1::DeployProcessorVersionRequest 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::DeployProcessorVersionRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::DeployProcessorVersionResponse > > |
|
virtual UndeployProcessorVersion(google::cloud::documentai::v1::UndeployProcessorVersionRequest 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::UndeployProcessorVersionRequest 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::cloud::documentai::v1::DeleteProcessorRequest 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::DeleteProcessorRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::DeleteProcessorMetadata > > |
|
virtual EnableProcessor(google::cloud::documentai::v1::EnableProcessorRequest 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::EnableProcessorRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::EnableProcessorResponse > > |
|
virtual DisableProcessor(google::cloud::documentai::v1::DisableProcessorRequest 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::DisableProcessorRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::DisableProcessorResponse > > |
|
virtual SetDefaultProcessorVersion(google::cloud::documentai::v1::SetDefaultProcessorVersionRequest 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::SetDefaultProcessorVersionRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::SetDefaultProcessorVersionResponse > > |
|
virtual ReviewDocument(google::cloud::documentai::v1::ReviewDocumentRequest 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::ReviewDocumentRequest const &
|
Returns |
Type |
Description |
future< StatusOr< google::cloud::documentai::v1::ReviewDocumentResponse > > |
|
virtual EvaluateProcessorVersion(google::cloud::documentai::v1::EvaluateProcessorVersionRequest 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::EvaluateProcessorVersionRequest 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 > |
|