Testing concept#
The tests are structured in the following hierarchy:
UI / E2E Tests β Cypress
Integration Tests, Penetatration Tests β SpringBootTest, WebTestClient, Testcontainers
Unit Tests β JUnit5, MockK, Vitest
π§° Tools & Libraries#
Testlayer |
Tools |
|---|---|
Unit |
JUnit5, MockK, Vitest |
Integration |
SpringBootTest, Testcontainers |
E2E |
Cypress |
Static Checks |
Sonarqube, ESLint |
Coverage |
JaCoCo, Sonarqube |
π΅οΈ Coverage Strategy#
Targets 80+% line coverage combined on frontend and backend controlled by Sonarqube.
Reports are added on new PRs by SonarQube.
π CI Integration#
GitHub Actions runs on every commit:
Linting
Unit + integration tests
Githun Actions runs on every PR/main branch commit:
E2E tests (headless)
Coverage reports
π§ͺ Running Tests#
Backend (Kotlin) in roomfinder-backend folder:
./gradlew test
./gradlew jacocoTestReport
Frontend (Next.js) in frontend folder:
npm run test # Unit tests
npx cypress open # Run E2E tests interactively
π Notes#
External API dependencies are mocked or stubbed during tests to ensure repeatability, using Wiremock.
Testcontainers are used to spin up real PostgreSQL/PostGIS instances for reliable integration tests.
Caching layers are tested for hit/miss logic and manual invalidation.