test(version-tests): add unit tests for client, domain, and service layers#572
Closed
margi212 wants to merge 2 commits into
Closed
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive unit test coverage across the
client,domain, andservicelayers of thedocling-version-testsmodule.Changes
New Test Classes
RegistryClientFactoryTestsRegistryClientFactoryGHCRClientLoggerTestsGHCRClientLoggerTagsTestRequestTestsTagsTestRequestNamedThreadFactoryTestsNamedThreadFactoryWorkParallelizerTestsWorkParallelizerExtended Test Classes
TagTestResultTestsTagsTestResultssorting,from()factory,toBuilder(),setResults()/clearResults(), failure detection, and nested/long stack trace handlingCoverage Highlights
RegistryClientFactory— validates correct client dispatch forghcr.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 oftokenfields in JSON bodies,AuthorizationandSet-Cookieheader 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 mandatoryexecutorfield enforcement.NamedThreadFactory— validates thread naming with incrementing suffix, isolated counters per factory instance, and thread-safe concurrent creation.WorkParallelizer— validates paralleltransformandrunsemantics 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 aTagsTestRequest, mutable builder operations, and failure presence detection.Test Design Notes
assertThat(AssertJ).CountDownLatch/AtomicIntegerto avoid race conditions in assertions.