Spring Boot Verification Loop
Run before PRs, after major changes, and pre-deploy.
When to Activate
- Before opening a pull request for a Spring Boot service
- After major refactoring or dependency upgrades
- Pre-deployment verification for staging or production
- Running full build → lint → test → security scan pipeline
- Validating test coverage meets thresholds
Phase 1: Build
If build fails, stop and fix.
Phase 2: Static Analysis
Maven (common plugins):
Gradle (if configured):
Phase 3: Tests + Coverage
Report:
- Total tests, passed/failed
- Coverage % (lines/branches)
Unit Tests
Test service logic in isolation with mocked dependencies:
Integration Tests with Testcontainers
Test against a real database instead of H2:
API Tests with MockMvc
Test controller layer with full Spring context:
Phase 4: Security Scan
Common Security Findings
Phase 5: Lint/Format (optional gate)
Phase 6: Diff Review
Checklist:
- No debugging logs left (
System.out,log.debugwithout guards) - Meaningful errors and HTTP statuses
- Transactions and validation present where needed
- Config changes documented
Output Template
Continuous Mode
- Re-run phases on significant changes or every 30–60 minutes in long sessions
- Keep a short loop:
mvn -T 4 test+ spotbugs for quick feedback
Remember: Fast feedback beats late surprises. Keep the gate strict—treat warnings as defects in production systems.


