Testing Requirements
Framework: Kotest Onlyβ
The project uses Kotest exclusively. JUnit Vintage is excluded from the test classpath. Never create JUnit test classes.
Which Spec Style to Useβ
Coverage Requirementsβ
Coroutine Testingβ
// Use runTest for suspend functions
class MyTest : FunSpec({
test("my suspend test") {
runTest {
val result = suspendFun()
result shouldBe expected
}
}
})
// Use .toList() to collect flows
test("parser emits correct records") {
val records = parser.parse(input, spec).toList()
records shouldHaveSize 10
}
Test Isolation β No Spring Contextβ
Never use @SpringBootTest in unit tests β instantiate classes directly and mock dependencies with MockK.
Running Testsβ
# All modules
./gradlew test
# Core only (fast β 53 tests)
./gradlew :platform-core:test
# With HTML report
./gradlew :platform-core:test && open platform-core/build/reports/tests/test/index.html
warning
All tests must pass before opening a PR. Run ./gradlew :platform-core:test before every commit.