- Clone the repository
- Launch server by running main from src/main/kotlin/MoneyFormatterServer.kt
- Have Kotest plugin installed
- Just launch any test you want through UI or terminal
It is lightweight, with great testability potential, and everything in it is function.
As a test framework I used Kotest because it allows writing BDD like tests with minimal effort. This way tests become executable requirements that are always up-to-date. And it supports property based testing from box. For better understanding of property based testing please see https://kotest.io/docs/proptest/property-based-testing.html#introduction-to-property-testing
Are property based tests. I was going to use BigDecimal generator from Kotest, but got NumberFormatException while checking its edgecases. It converts double edge cases to BigDecimal and fails on Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY. That's why I wrote myBigDecimals that could be found in Arbs.kt
Are tests on app level which is httphandler, function that accepts Request and returns Response.
Just for testing that end-point is properly wired.
- Documentation of API's with OpenApi3
- Contract tests
- Chaos testing, for more details please see https://www.http4k.org/guide/modules/chaos
- Performance tests