Skip to content

test(version-tests): add tests for client, domain, and service layers#570

Open
margi212 wants to merge 2 commits into
docling-project:mainfrom
margi212:test--add-test-cases
Open

test(version-tests): add tests for client, domain, and service layers#570
margi212 wants to merge 2 commits into
docling-project:mainfrom
margi212:test--add-test-cases

Conversation

@margi212

Copy link
Copy Markdown

Summary

Adds comprehensive unit test coverage across the client, domain, and service layers of the docling-version-tests module.


Changes

New Test Classes

File Class Under Test # Tests
RegistryClientFactoryTests RegistryClientFactory 8
GHCRClientLoggerTests GHCRClientLogger 16
TagsTestRequestTests TagsTestRequest 17
NamedThreadFactoryTests NamedThreadFactory 7
WorkParallelizerTests WorkParallelizer 10

Extended Test Classes

File What was added
TagTestResultTests 9 new tests for TagsTestResults sorting, from() factory, toBuilder(), setResults()/clearResults(), failure detection, and nested/long stack trace handling

Coverage Highlights

  • RegistryClientFactory — validates correct client dispatch for ghcr.io, plus rejection of unsupported, null, empty, whitespace-padded, and case-mismatched registry strings; verifies client instance reuse.
  • GHCRClientLogger — validates conditional request/response logging, masking of token fields in JSON bodies, Authorization and Set-Cookie header redaction, and graceful handling of null, empty, non-JSON, and JSON-array bodies.
  • TagsTestRequest — validates builder construction, toBuilder() round-trip fidelity, method chaining, override behavior, and mandatory executor field enforcement.
  • NamedThreadFactory — validates thread naming with incrementing suffix, isolated counters per factory instance, and thread-safe concurrent creation.
  • WorkParallelizer — validates parallel transform and run semantics across empty, single, multi-item, and large (100-item) workloads with type-safe generic transformation.
  • TagTestResult / TagsTestResults — extends existing tests with version-sorted result sets, factory construction from a TagsTestRequest, mutable builder operations, and failure presence detection.

Test Design Notes

  • All tests follow Arrange / Act / Assert structure with assertThat (AssertJ).
  • Edge cases (null, empty, whitespace) are tested explicitly to guard against NPEs and silent failures.
  • Concurrent tests use CountDownLatch / AtomicInteger to avoid race conditions in assertions.
  • No production code was modified; this PR is purely additive test coverage.

margi212 added 2 commits June 27, 2026 10:55
…ervice layers

- Add RegistryClientFactoryTests: GHCR client resolution, unsupported/null/empty/whitespace/case-sensitive registry, instance reuse
- Add GHCRClientLoggerTests: request/response logging toggle, token/header masking, null/empty/non-JSON body, redirect response
- Add TagsTestRequestTests: builder construction, toBuilder(), field setters, null/empty edge cases, executor null validation
- Add NamedThreadFactoryTests: named thread creation, counter increment, separate factory counters, runnable execution, concurrent creation
- Add WorkParallelizerTests: parallel transform/run, empty/single/large lists, multi-type transformation, concurrent execution
- Extend TagTestResultTests: TagsTestResults sorting, from() factory, toBuilder(), setResults()/clearResults(), failure detection

Signed-off-by: Margi <39212098+margi212@users.noreply.github.com>
@margi212 margi212 changed the title Adds comprehensive unit test coverage across the client, domain, and service layers of the docling-version-tests module. test: Adds comprehensive unit test coverage across the docling-version-tests module. Jun 29, 2026
@margi212 margi212 changed the title test: Adds comprehensive unit test coverage across the docling-version-tests module. test(version-tests): add tests for client, domain, and service layers Jun 29, 2026
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.

1 participant