Problem statement
JSON-RPC tests repeatedly assert the same protocol patterns (success response shape, error code expectations, notification no-response behavior). This leads to duplicated assertions and lower readability across modules and downstream adopters.
Proposed solution
Add a dedicated jsonrpc-test-utils module with reusable assertion helpers, for example:
assertSuccess(response)
assertErrorCode(response, expectedCode)
assertNotificationNoResponse(dispatchResult)
- optional batch helpers for count and per-id checks
Design goals:
- concise and intention-revealing test code
- reusable across
jsonrpc-core, spring-webmvc, samples, and external projects
- no runtime dependency impact for production artifacts
Alternatives considered
- Continue using local ad-hoc assertion methods in each test class
- Publish only copy-paste snippets in docs
These options keep duplication and inconsistency.
JSON-RPC behavior impact
No protocol behavior change. This is test support only.
Additional context
- Keep the module lightweight and JUnit 5 friendly.
- Provide examples in sample tests.
- Ensure assertions cover both single and batch response scenarios.
Problem statement
JSON-RPC tests repeatedly assert the same protocol patterns (success response shape, error code expectations, notification no-response behavior). This leads to duplicated assertions and lower readability across modules and downstream adopters.
Proposed solution
Add a dedicated
jsonrpc-test-utilsmodule with reusable assertion helpers, for example:assertSuccess(response)assertErrorCode(response, expectedCode)assertNotificationNoResponse(dispatchResult)Design goals:
jsonrpc-core,spring-webmvc, samples, and external projectsAlternatives considered
These options keep duplication and inconsistency.
JSON-RPC behavior impact
No protocol behavior change. This is test support only.
Additional context