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.