test: improve backend branch coverage (currently 46%) #148
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The JaCoCo branch coverage gate added in #120 is set to 42% minimum. Current measured coverage is 46% — only 4 percentage points of headroom. This issue tracks improving test coverage in the weakest areas.
Current coverage by package (last
mvnw verifyrun)securityservicecontrollerrepositoryPriority areas
repository— 0% (0/24 branches)Zero coverage. The
@DataJpaTesttests added in #119 coverDocumentRepositoryandPersonRepository, but these 24 repository branches likely come from custom JPQL/derived query methods that need assertion-level tests, not just happy-path saves.controller— 26% (13/50 branches)Controllers have many
if-blocks for permission checks, null guards, and error paths. These are not covered by unit tests and would benefit from@WebMvcTestslice tests or MockMvc integration tests.service— 50% (241/478 branches)The largest package. Many error branches in
DocumentService,MassImportService, andUserServiceare untested. Consider targeted unit tests with mocked repositories for error paths.Gate
The current minimum is 42%. Any PR that drops coverage below this will fail
mvnw verify. Aim to raise the gate as coverage improves — suggested milestones: 50% → 60% → 70%.