Skip to content

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

Closed
margi212 wants to merge 2 commits into
docling-project:mainfrom
margi212:test/add-coverage-client-domain-service-layers
Closed

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

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 29, 2026 17:26
…ayers

Add test coverage for RegistryClientFactory, GHCRClientLogger,
TagsTestRequest, TagTestResult/TagsTestResults, NamedThreadFactory,
and WorkParallelizer classes.

The client layer tests verify registry dispatch, unsupported/null/
empty/whitespace/case-sensitive input rejection, and header/token
masking in the HTTP logger. The domain layer tests validate builder
construction, toBuilder() fidelity, version-sorted result sets,
failure detection, and null edge cases. The service layer tests
cover named thread creation with incrementing counters and parallel
task execution with both transform and run semantics.

Signed-off-by: Margi <39212098+margi212@users.noreply.github.com>
@margi212 margi212 closed this Jun 29, 2026
@margi212 margi212 deleted the test/add-coverage-client-domain-service-layers branch June 29, 2026 12:13
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