A direct map of source files to test files shows several public, high-traffic classes have no dedicated test class under lib/src/test/kotlin/: ARCPClient.kt (only exercised transitively by tests/src/test/kotlin/dev/arcp/tests/HandshakeTest.kt), ARCPRuntime.kt (same), JwtAuth.kt (no test at all), BudgetRegistry.kt (the per-counter BudgetCounterTest exists but the registry's lifecycle, including terminate clearing both maps, is untested), MemoryTransport.kt (no test), UpstreamErrorTranslator.kt (no test), CapabilityNegotiation.kt (no test — and three open bugs already reference this file: #51 and the new issue above on extension rejection), and CompiledSubscriptionFilter.kt (no test). The tests/ integration suite covers happy paths, but unit tests give cheaper, faster signal on per-method invariants and edge cases. This is distinct from #56, which tracks the aggregate Kover coverage threshold rather than specific test additions.
Fix prompt: For each class listed above add a focused unit test class. Minimum coverage per class: ARCPClient handshake error mapping (rejection codes, unexpected-payload), ARCPRuntime dispatcher behavior for all handleEnvelope branches (covered partially by HandshakeTest), JwtAuth skew tolerance, audience and issuer checks, BudgetRegistry register/consume/terminate/remaining sequence, MemoryTransport ordering, backpressure, and close behavior, UpstreamErrorTranslator mapping rules, CapabilityNegotiation boolean intersection, heartbeat min, binary encoding negotiation (including #51), extensions handling (including the new "do not reject on unknown extensions" rule), and CompiledSubscriptionFilter.matches empty-set semantics, minPriority threshold, and per-field membership. Prefer parameterized tests where the inputs are tabular.
A direct map of source files to test files shows several public, high-traffic classes have no dedicated test class under
lib/src/test/kotlin/:ARCPClient.kt(only exercised transitively bytests/src/test/kotlin/dev/arcp/tests/HandshakeTest.kt),ARCPRuntime.kt(same),JwtAuth.kt(no test at all),BudgetRegistry.kt(the per-counterBudgetCounterTestexists but the registry's lifecycle, includingterminateclearing both maps, is untested),MemoryTransport.kt(no test),UpstreamErrorTranslator.kt(no test),CapabilityNegotiation.kt(no test — and three open bugs already reference this file: #51 and the new issue above on extension rejection), andCompiledSubscriptionFilter.kt(no test). Thetests/integration suite covers happy paths, but unit tests give cheaper, faster signal on per-method invariants and edge cases. This is distinct from #56, which tracks the aggregate Kover coverage threshold rather than specific test additions.Fix prompt: For each class listed above add a focused unit test class. Minimum coverage per class:
ARCPClienthandshake error mapping (rejection codes, unexpected-payload),ARCPRuntimedispatcher behavior for allhandleEnvelopebranches (covered partially by HandshakeTest),JwtAuthskew tolerance, audience and issuer checks,BudgetRegistryregister/consume/terminate/remaining sequence,MemoryTransportordering, backpressure, and close behavior,UpstreamErrorTranslatormapping rules,CapabilityNegotiationboolean intersection, heartbeat min, binary encoding negotiation (including #51), extensions handling (including the new "do not reject on unknown extensions" rule), andCompiledSubscriptionFilter.matchesempty-set semantics, minPriority threshold, and per-field membership. Prefer parameterized tests where the inputs are tabular.