Testing Standards & Strategy¶
Testing across CIS microservices emphasizes automated verification, fast feedback loops, and authentic environment fidelity.
Testing Pyramid¶
pie title CIS Test Distribution
"Unit & Web Slice Tests (RestTestClient / MockMvc)" : 65
"Integration Tests (Testcontainers Oracle / Redis / LDAP)" : 30
"Contract & End-to-End Tests" : 5
Guides & References¶
- Integration Testing Guide: Detailed configuration and patterns for Docker Testcontainers (Oracle 23, Redis 7.4, OpenLDAP).
- Build & Test Guide: Gradle commands for slice tests, offline test execution, and JaCoCo coverage reports.
Testing Principles¶
- RestTestClient for Web Slices:
In Spring Boot 4.1.2 (Spring Framework 7), prefer
RestTestClientover rawMockMvcfor cleaner, fluent assertions and seamless alignment with modern HTTP client testing. - AssertJ Fluent Assertions:
Always prefer AssertJ assertions (
assertThat(...)) over JUnit 5 assertions for rich failure diagnostics. - No Mocks for Critical Infrastructure: Database, Redis token revocation, and LDAP queries must be validated against real Testcontainers instances in integration test suites.