code: shared test scaffolding sweep
- Commit
493b7b8c45753785657551cdfdd06a6ba24bd373- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-01 22:48 UTC (4 days ago)
- Parents
2e917a3
Replace the local FakeTokenSealer implementation with a thin adapter delegating to the shared FakeTokenSealing logic in build-logic/shared-test. Remove class-level @Config(sdk = [34]) annotations that only duplicate the repo-wide sdk=34 default in build-logic/shared-test-resources/robolectric.properties, dropping the Config import where it becomes unused. Qualifier/shadow/application and non-34 configs are untouched; files dirty from other agents' in-flight work were skipped file-by-file. Verified: :code:testDevUnitTest green in the shared-fake batch (BUILD SUCCESSFUL). Lint (:lint / :lintVitalRelease) was not run for this module in this sweep.
Diff
code/src/test/java/com/vayunmathur/code/data/FakeTokenSealer.kt
diff --git a/code/src/test/java/com/vayunmathur/code/data/FakeTokenSealer.kt b/code/src/test/java/com/vayunmathur/code/data/FakeTokenSealer.ktindex bce7767232..5a1617bca8 100644--- a/code/src/test/java/com/vayunmathur/code/data/FakeTokenSealer.kt+++ b/code/src/test/java/com/vayunmathur/code/data/FakeTokenSealer.kt@@ -1,23 +1,12 @@ package com.vayunmathur.code.data -/**- * Host-test [TokenSealer]: Robolectric has no AndroidKeyStore, so tests seal with a- * reversible marker transform instead of AES-GCM. Mirrors the real sealer's contract —- * sealed values carry the `v1:` prefix, legacy values pass through, foreign sealed- * values fail (null) rather than passing through.- */-class FakeTokenSealer : TokenSealer {- override fun seal(plain: String): String = SEALED_PREFIX + plain+import com.vayunmathur.testsupport.FakeTokenSealing - override fun unseal(stored: String): String? = when {- stored.startsWith(SEALED_PREFIX) -> stored.removePrefix(SEALED_PREFIX)- isSealed(stored) -> null- else -> stored- }+/** Host-test [TokenSealer] delegating to the shared [FakeTokenSealing] logic. */+class FakeTokenSealer : TokenSealer {+ override fun seal(plain: String): String = FakeTokenSealing.seal(plain) - override fun isSealed(stored: String): Boolean = stored.startsWith(KeystoreTokenSealer.PREFIX)+ override fun unseal(stored: String): String? = FakeTokenSealing.unseal(stored) - private companion object {- private const val SEALED_PREFIX = "v1:fake:"- }+ override fun isSealed(stored: String): Boolean = FakeTokenSealing.isSealed(stored) }