Skip to content

test: raise line/branch coverage across library, adapters, and persistence#43

Merged
wolpert merged 2 commits into
mainfrom
test/coverage-hardening-library-adapters-persistence
Jun 9, 2026
Merged

test: raise line/branch coverage across library, adapters, and persistence#43
wolpert merged 2 commits into
mainfrom
test/coverage-hardening-library-adapters-persistence

Conversation

@wolpert

@wolpert wolpert commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds targeted unit and integration tests across every published module to close JaCoCo line/branch coverage gaps. No production code changed — tests only. Every touched module's ./gradlew check (spotless + coverage verify) passes.

Coverage results

Module Line (before → after) Branch (before → after)
pk-auth-refresh-tokens none (gate skipped) → 99% none → 87%
pk-auth-jwt 82% → 91% 73% → 90%
pk-auth-core 83% → 93% 66% → 78%
pk-auth-micronaut 72% → 93% 39% → 66%
pk-auth-spring-boot-starter 86% → 90% 57% → 77%
pk-auth-dropwizard 78% → 85% 55% → 61%
pk-auth-persistence-dynamodb 83% → 94.5% 44% → 67%
pk-auth-persistence-jdbi 80% → 95% 63% → 69%

What was added

  • refresh-tokens — had zero tests and its coverage gate was silently SKIPPED (no execution data). Now driven via RefreshTokenScenarios plus service, handler, record, config, TTL-policy, and deletion-listener tests; the 70% gate is now actually enforced.
  • jwtPkAuthJwtValidator malformed / missing-claim / wrong-shape branches via hand-built signed JWTs, plus JwtClaims and TokenTtlPolicy.
  • core — registration happy path (persistRegistration) and evaluateAttestation decisions via a mocked WebAuthn4J RegistrationData chain; in-memory rate limiter / window counter; SPI carrier records; persistence exceptions.
  • micronaut / spring / dropwizard — authenticated admin-endpoint paths (list/rename/delete/backup-code count/email+phone verification) and the config-builder factory/auto-config validation + TTL-defaulting branches.
  • persistence (jdbi + dynamodb) — repository mutation/bulk paths the shared scenarios don't exercise: credential updateSignCount/updateLabel/delete/deleteByUserHandle, user-lookup register/findViewByHandle, backup-code replaceAll, OTP deleteByUserHandle, refresh deleteExpiredBefore. All against real Postgres / DynamoDB Local via Testcontainers.

Latent issues fixed along the way

  • refresh-tokens coverage verification was vacuously skipped (no tests existed) — now enforced.
  • The Spring admin integration suite didn't reset the shared in-memory ceremony rate limiter between tests, so added cases tripped the per-IP limit; added a @BeforeEach reset.

Remaining (out of scope)

The residual uncovered code is concentrated in per-repo wrap(...) SDK/JDBI exception-handler catch blocks, which require induced backend failures (fault injection) to reach.

🤖 Generated with Claude Code

wolpert and others added 2 commits June 9, 2026 06:51
…tence

Adds targeted unit and integration tests across every published module to
close JaCoCo line/branch gaps surfaced by the per-module reports. No
production code changed — tests only.

Highlights:
- refresh-tokens: was 0 tests with a silently-SKIPPED coverage gate (no
  execution data) — now driven via RefreshTokenScenarios plus service,
  handler, record, config, and deletion-listener tests; gate now enforced.
- jwt: cover PkAuthJwtValidator malformed/missing-claim/wrong-shape branches
  via hand-built raw JWTs, plus JwtClaims and TokenTtlPolicy.
- core: registration happy-path (persistRegistration) and evaluateAttestation
  decisions via mocked WebAuthn4J RegistrationData; in-memory rate
  limiter/window counter; SPI carrier records; persistence exceptions.
- micronaut / spring / dropwizard: authenticated admin-endpoint paths and the
  config-builder factory/auto-config validation+defaulting branches.
- persistence (jdbi + dynamodb): repository mutation/bulk paths not exercised
  by the shared scenarios — credential update/delete, user-lookup
  register/findView, backup-code replaceAll, otp deleteByUserHandle, refresh
  deleteExpiredBefore.

Also fixes two latent issues found along the way:
- refresh-tokens coverage verification was vacuously skipped (no tests).
- Spring admin integration suite did not reset the shared in-memory ceremony
  rate limiter between tests, tripping the per-IP limit as cases were added;
  added a @beforeeach reset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wolpert
wolpert enabled auto-merge (rebase) June 9, 2026 13:55
@wolpert
wolpert merged commit 6ce48f1 into main Jun 9, 2026
3 checks passed
@wolpert
wolpert deleted the test/coverage-hardening-library-adapters-persistence branch June 9, 2026 13:57
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