Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 2.73 KB

File metadata and controls

47 lines (31 loc) · 2.73 KB

Testing

Test stack

The project uses Maven, JUnit 4, Mockito, and Java 11. Dependency versions are defined in pom.xml.

Verification commands

Run the full unit test suite before handing off changes:

mvn test

Run the documentation link checker after documentation edits:

python3 /Users/rcortezbellottideoli/.codex/skills/project-docs/scripts/check-docs-links.py .

Test layout

Test Source under test Behavior covered
ClientForwardingHandlerTest ClientForwardingHandler Records call start and sent request messages.
ServerForwardingHandlerTest ServerForwardingHandler Records call start, sent response messages, completion status, and latency.
ClientCallListenerTest ClientCallListener Delegation, received response messages, completion status, and latency.
ServerCallListenerTest ServerCallListener Delegation and received request messages.
CallTrackerTest CallTracker, GeneralMetrics, MethodDefinition Label application, counters, failure handling, and latency histogram recording.

Naming rules

Unit test classes must be named after the class they test, using the ClassNameTest pattern. Examples:

  • CallTracker -> CallTrackerTest
  • ClientForwardingHandler -> ClientForwardingHandlerTest

Adding tests

  • Add or update unit tests for behavior changes.
  • Prefer focused tests that verify the tracker method called by a handler or listener.
  • For metric family or label changes, use an isolated CollectorRegistry to avoid global registry state and assert collected labels/samples.
  • Keep test fixtures close to the behavior under test; this repository currently uses Mockito mocks rather than spinning up an end-to-end gRPC server.

Coverage expectation

CONTRIBUTING.md says code changes should include relevant unit tests and should not drop code coverage below 75%.