Testing
Backend
The backend has two types of tests, each run by a different Maven plugin.
Unit Tests
Unit tests use JUnit 5 with Mockito and don’t require a running database or application context. They follow the *Test.java naming pattern and are run by the Maven Surefire plugin.
cd backend/spring-boot
mvn -B testTo run a single test class:
mvn -B test -Dtest=MessageServiceTestTo run a single test method:
mvn -B test -Dtest=MessageServiceTest#getMessageIntegration Tests
Integration tests use Spring Boot Test with Testcontainers to spin up real PostgreSQL and Redis instances in Docker. They follow the *IT.java naming pattern and are run by the Maven Failsafe plugin.
cd backend/spring-boot
mvn -B failsafe:integration-test failsafe:verifyTo run a single integration test:
mvn -B failsafe:integration-test -Dit.test=AuthControllerIT failsafe:verifyAll integration tests extend the DatabaseContainers base class, which defines shared PostgreSQL and Redis containers using @ServiceConnection for automatic Spring Boot configuration.
Docker must be running for integration tests to work.
Frontend
Unit Tests
Unit tests use Vitest . Test files follow the *.{test,spec}.{js,ts} pattern inside src/.
cd frontend/svelte-kit
pnpm run test:unitEnd-to-End Tests
E2E tests use Playwright with Firefox. Test files are in the tests/ directory. Playwright builds the app and starts a preview server on port 4173 before running.
cd frontend/svelte-kit
pnpm run test:integrationTo run both unit and E2E tests:
pnpm run test