Skip to content

test(client): run the shared suite against the client under test - #796

Merged
edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:fix/tests-use-client-under-test
Nov 12, 2026
Merged

edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:fix/tests-use-client-under-test

Conversation

@edeandrea

Copy link
Copy Markdown
Contributor

DoclingServeJackson2ClientTests and DoclingServeJackson3ClientTests built their auth and WireMock clients with doclingClient.config().toBuilder()...build(). DoclingServeApiConfig.toBuilder() returns the SPI DoclingServeApiBuilder, which goes through DoclingServeClientProvider, and that prefers Jackson 3 whenever it is on the classpath. So in the Jackson 2 suite, every test using getDoclingClient() (which defaults to the auth client) or getDoclingClient(false, true) was actually exercising DoclingServeJackson3Client.

Found while reviewing #785.

Change

  • Each suite builds all its clients through a newClient(DoclingServeApiConfig) helper that calls DoclingServeJacksonNClient.builder().config(config).build(). The configs come from DoclingServeApi.builder() / config().toBuilder(), so nothing goes through the deprecated DoclingApiBuilder default methods.
  • New AbstractDoclingServeClientTests#everyClientIsTheImplementationUnderTest asserts that the auth and WireMock clients are exactly the same class as the main client. It fails on main for the Jackson 2 suite (Expecting actual: DoclingServeJackson3Client ... to be exactly an instance of DoclingServeJackson2Client).

Tests

./gradlew :docling-serve-client:test passes locally (241 tests), so the Jackson 2 client does pass the full shared suite.

Not in this PR

DoclingServeClientBuilder has no non-deprecated baseUrl(String), logRequests(), logResponses() or prettyPrint(): they only exist as default methods of the deprecated DoclingApiBuilder. The getDoclingClientWith…Deserializer() helpers still use them and will break when that interface is removed.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 15:38
DoclingServeApiConfig.toBuilder() goes through the provider, which prefers
Jackson 3 when it is on the classpath. The Jackson 2 suite derived its auth
and WireMock clients from it, so every test using them ran against the
Jackson 3 client instead.

Build every client from a DoclingServeApiConfig with the concrete builder's
config(...), and guard that all clients of a suite are the implementation
under test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
@edeandrea
edeandrea force-pushed the fix/tests-use-client-under-test branch from e70867e to bb79405 Compare November 12, 2026 15:39
@edeandrea
edeandrea enabled auto-merge (squash) November 12, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the implementation-specific client setup and regression-test changes.

No open issues 🎉

What changed in this PR

Ensures the shared client tests exercise the intended Jackson implementation, preventing Jackson 2 authentication and WireMock tests from silently using Jackson 3 through provider discovery.

Changes:

  • Builds each suite’s clients through implementation-specific helpers using DoclingServeApiConfig.
  • Adds a shared regression test verifying that authentication and WireMock clients match the main client’s concrete class.
File Description
docling-serve/​docling-serve-client/​src/​test/​java/​ai/​docling/​serve/​client/​DoclingServeJackson3ClientTests.java Explicitly constructs Jackson 3 clients for all setup variants.
docling-serve/​docling-serve-client/​src/​test/​java/​ai/​docling/​serve/​client/​DoclingServeJackson2ClientTests.java Explicitly constructs Jackson 2 clients, bypassing provider selection.
docling-serve/​docling-serve-client/​src/​test/​java/​ai/​docling/​serve/​client/​AbstractDoclingServeClientTests.java Adds assertions guarding against mismatched client implementations.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 12, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the changes to implementation-specific test client construction.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 52.46% 🟢

There is no coverage information present for the Files changed

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)2344 ran2344 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@edeandrea
edeandrea disabled auto-merge November 12, 2026 16:16
@edeandrea
edeandrea merged commit d4f64d0 into docling-project:main Nov 12, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants