Skip to content

Legacy Oracle Test and Coverage Workflow

Paulo Gomes da Cruz Junior edited this page Nov 12, 2026 · 1 revision

Legacy Oracle Test and Coverage Workflow

The legacy module separates fast unit tests from Oracle-backed integration tests, then combines their JaCoCo data when the full verification profile runs.

Run the complete verification profile

From the repository root, enter the legacy module and run:

cd legacy
mvn verify -P all-tests

The all-tests profile enables Surefire unit tests, Failsafe integration tests, JaCoCo, and Checkstyle for production and test sources. Failsafe selects *IntegrationTest.java; Surefire excludes those classes. Use verify so Failsafe reaches its verification phase.

The integration suite uses Oracle through Testcontainers. A Docker or compatible container runtime must be available. A passing unit-only run does not verify Oracle mappings, queries, triggers, or container-backed repository behavior.

Read the reports

The build writes reports under legacy/target/:

Report Contents
coverage-reports/jacoco-ut/ Unit-test execution and coverage
coverage-reports/jacoco-it/ Integration-test execution and coverage
coverage-reports/merged-test-report/ Merged coverage
surefire-reports/ Unit-test results
failsafe-reports/ Integration-test results

For a total coverage view, use merged-test-report, not either individual report. JaCoCo excludes configuration, DTO, entity, exception, repository, generated builder, application entry-point, and constants classes. Coverage percentages therefore describe the remaining instrumented classes, not every production line. The configured coverage gate checks bundle line coverage at 85%; it does not enforce a branch-coverage minimum.

The local report snapshot from 2026-11-12 recorded 241 unit tests and 74 integration tests, with no failures, errors, or skips. In the merged JaCoCo report, line and method coverage were 100%, branch coverage was 97.2%, and instruction coverage was 99.7%. Treat these values as a dated snapshot, not a permanent baseline.

Keep Oracle fixtures isolated

Integration tests can share one Testcontainers database. Commit fixture writes inside an explicit transaction when the datasource uses auto-commit=false; otherwise the pool can return a connection with uncommitted fixture data. Avoid deleting shared reference rows such as hrs.district_volume, which other tests may need. Give test records bounded date ranges when open-ended records can collide.

When failsafe:verify reports failures despite a fresh green test run, check whether legacy/target/surefire-reports or legacy/target/failsafe-reports contains stale results from another run before diagnosing the code. Confirm the report timestamps and rerun the full profile to establish current evidence.

Sources

  • legacy/pom.xml — test profile, test selection, JaCoCo merge, exclusions, and line-coverage gate.
  • AbstractTestContainerIntegrationTest.java — shared Oracle container setup.
  • Tracing Test Setup — tracing configuration for Spring integration tests.
  • Shared transaction and database fixture lessons also appear in the backend knowledge base.

Waste Plus Wiki

Home

Architecture

Codes

Decisions

Knowledge Base

Development

Changes

Clone this wiki locally