Add unit tests to analytics service
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Add src/test unit tests for all services and repositories in the analytics microservice. Tests use mocked dependencies — no external infrastructure (ClickHouse, Docker) required to run them.
This slice depends on #35050 being complete so tests are written on clean, stable code.
Parent epic: #35048
Acceptance Criteria
- Unit tests added for all public methods in all service classes
- Unit tests added for all public methods in all repository classes
- All dependencies mocked (no real ClickHouse or network calls)
- Tests run with
./mvnw test— no external infrastructure needed - All tests pass on
Additional Context
- Source task: Task 3 (Unit tests) from the improvement plan
- Blocked by: #35050 (ingest code refactor must be done first)
- Framework: JUnit 5 + Mockito (standard for this project)
- Related branch:
issue-34849-Add-dotCMS-Analytics-Proxy-Endpoint-for-/v1/analytics/-to-dot-ca-event-manager
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the analytics microservice's src/test directory and inspect the service and repository classes whose public methods need coverage. Use JUnit 5 and Mockito, with all dependencies mocked, and run ./mvnw test. Done means every public service and repository method has passing unit tests without ClickHouse, Docker, network calls, or other external infrastructure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100