Skip to content

refactor(test): adopt Kotest 6.x data-driven testing and withClue (KOJAK-57)#21

Merged
endrju19 merged 1 commit intomainfrom
kotest
Apr 8, 2026
Merged

refactor(test): adopt Kotest 6.x data-driven testing and withClue (KOJAK-57)#21
endrju19 merged 1 commit intomainfrom
kotest

Conversation

@endrju19
Copy link
Copy Markdown
Collaborator

@endrju19 endrju19 commented Apr 7, 2026

Summary

  • Replace 5 repetitive status-code tests in HttpMessageDelivererTest with a single withTests block using StatusCodeCase data class (Kotest 6.x data-driven testing)
  • Add withClue to ConcurrentClaimTests assertions for richer failure diagnostics (claimed set contents, DB state context)
  • Reviewed all Kotest 6.0 breaking changes — none affect this project

Details

Kotest was already bumped from 5.9.1 → 6.1.10 by Dependabot. This PR completes the upgrade by adopting new Kotest 6.x features:

Data-driven testing (HttpMessageDelivererTest):
5 tests with identical structure (stub status code → assert result type) collapsed into one withTests block. Uses StatusCodeCase data class implementing WithDataTestName for stable test names.

withClue (ConcurrentClaimTests):
Concurrent test assertions now include diagnostic context (overlap IDs, claimed set sizes, DB state map) — critical for debugging non-deterministic race condition failures.

blockingTest — deliberately not adopted: analyzed all blocking test patterns; blockingTest only affects the main test thread (not spawned threads), loses fast-fail semantics, and produces generic timeout errors instead of specific assertion failures.

Test plan

  • All unit tests pass (okapi-core, okapi-http, okapi-kafka — 70 tests)
  • Full project compilation succeeds
  • ktlint clean
  • CI pipeline (integration tests with Testcontainers)

…JAK-57)

- Replace 5 repetitive status-code tests in HttpMessageDelivererTest with
  a single withTests block using StatusCodeCase data class
- Add withClue to ConcurrentClaimTests assertions for richer failure
  diagnostics (claimed set contents, DB state context)
@endrju19 endrju19 merged commit 1b72937 into main Apr 8, 2026
8 checks passed
@endrju19 endrju19 deleted the kotest branch April 8, 2026 07:39
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