////
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
////
== Camel Quarkus Docling Integration Tests

By default, the Docling integration tests use WireMock to stub docling-serve API interactions.
This avoids pulling the `quay.io/docling-project/docling-serve` container image (which exceeds 20 GB) in CI.

=== Running against a real docling-serve container

To run the tests against the real docling-serve container, set:

[source,shell]
----
-Dcamel.quarkus.start-mock-backend=false
----

The test resource will start the container automatically.

=== Refreshing WireMock stub recordings

If the stub recordings need updating (e.g. after a docling-serve version bump), remove the existing files from
`src/test/resources/mappings` and `src/test/resources/__files`, then run the tests with a real container and
recording enabled:

[source,shell]
----
-Dcamel.quarkus.start-mock-backend=false -Dwiremock.record=true
----

Or via environment variable:

[source,shell]
----
export WIREMOCK_RECORD=true
----

Commit the newly generated stub files alongside any version bump.

=== CLI mode test

One test (`convertToJsonWithCLI`) exercises the component's local CLI mode, which invokes the `docling` binary
directly rather than calling the HTTP API. This test requires docling to be installed locally, for example with:

[source,shell]
----
pip install docling
----

To activate this test, set:

[source,shell]
----
-Ddocling.test.enabled=true
----
