test(coverage): close the clean JVM-testable coverage gaps (~11 files → ~95% logic) #288

Closed
opened 2026-07-04 05:44:17 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 05:44:17 +00:00 (Migrated from github.com)

From the Phase-2 JaCoCo audit — the cleanly JVM-testable classes below 95% line. All close with plain unit tests (mockk the DAO/collaborator); several EXTEND an existing test. No emulator.

DAO-backed repos:

  • data/settings/AccountSettingsRepository (38.5%, 16) — add sibling setters (setSignatureEnabled/NotificationsEnabled/RetentionCount/RetentionMonths) + observe Flow (Turbine); extend AccountSettingsRepositoryTest.
  • data/settings/SignatureRepository (63.2%, 7) — observeForAccount/get/getDefault/update/toDomain; extend SignatureRepositoryTest.
  • data/security/CredentialStore (0%, 10) — new test, mockk<KeystoreCrypto> (identity) + mockk<CredentialDao>.

Guard + attachment:

  • data/security/EncryptedCacheGuard (0%, 7) — isCacheLocked() truth table; mockk SettingsRepository + PassphraseSession.
  • data/attachment/AttachmentUriGrants (5.3%, 18) — releaseUnreferenced/referencedUris with mockk<DraftDao>/<OutboxDao> + mockk<Context> (JVM mockk<Context> is fine — the no-mockk-Context rule is instrumented-only).

Near-threshold extensions:

  • data/sync/SyncScheduler (90.2%, 5) — schedulePeriodicReportPurge + PERIODIC_POLICY; extend SyncSchedulerTest.
  • ui/lock/AppLockViewModel (92.8%, 8) — getNonce, onBackground branch, unwrapSealedPassphrase, awaitSyncEnqueue; extend AppLockViewModelTest.
  • mail/SmtpSender (91.8%, 6) — send error path + bodyPart branch; extend GreenMail SmtpSenderTest.
  • ui/reporting/StartupReportViewModel (93.3%, 1) — init lambda.

Validate with :app:testDebugUnitTest + :app:jacocoTestReport (confirm each climbs to ≥95%). No emulator.

From the Phase-2 JaCoCo audit — the cleanly JVM-testable classes below 95% line. All close with plain unit tests (mockk the DAO/collaborator); several EXTEND an existing test. **No emulator.** **DAO-backed repos:** - `data/settings/AccountSettingsRepository` (38.5%, 16) — add sibling setters (`setSignatureEnabled/NotificationsEnabled/RetentionCount/RetentionMonths`) + `observe` Flow (Turbine); extend `AccountSettingsRepositoryTest`. - `data/settings/SignatureRepository` (63.2%, 7) — `observeForAccount/get/getDefault/update/toDomain`; extend `SignatureRepositoryTest`. - `data/security/CredentialStore` (0%, 10) — new test, `mockk<KeystoreCrypto>` (identity) + `mockk<CredentialDao>`. **Guard + attachment:** - `data/security/EncryptedCacheGuard` (0%, 7) — `isCacheLocked()` truth table; mockk `SettingsRepository` + `PassphraseSession`. - `data/attachment/AttachmentUriGrants` (5.3%, 18) — `releaseUnreferenced/referencedUris` with `mockk<DraftDao>/<OutboxDao>` + `mockk<Context>` (JVM `mockk<Context>` is fine — the no-mockk-Context rule is instrumented-only). **Near-threshold extensions:** - `data/sync/SyncScheduler` (90.2%, 5) — `schedulePeriodicReportPurge` + `PERIODIC_POLICY`; extend `SyncSchedulerTest`. - `ui/lock/AppLockViewModel` (92.8%, 8) — `getNonce`, `onBackground` branch, `unwrapSealedPassphrase`, `awaitSyncEnqueue`; extend `AppLockViewModelTest`. - `mail/SmtpSender` (91.8%, 6) — `send` error path + `bodyPart` branch; extend GreenMail `SmtpSenderTest`. - `ui/reporting/StartupReportViewModel` (93.3%, 1) — init lambda. Validate with `:app:testDebugUnitTest` + `:app:jacocoTestReport` (confirm each climbs to ≥95%). No emulator.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#288