Do your automated tests serve you well? Or does it seem like they are deliberately getting in a way, slowing down any change? Has the “given”’s preparation become an arduous journey littered with shortcuts? The ever-increasing delivery pace raises the bar for test automation quality. Many teams are good at producing decent test coverage, but often at the price of tests maintainability – which can quickly become a bottleneck. Advanced testing frameworks like Cucumber, Spock, etc., can bring some remedy, but add their own complexity and compromises.
With the help of such Kotlin features as:
- named functional parameters
- default parameter values
- and especially DSLs (Type-Safe Builders)
The expressiveness of tests can be drastically improved.Add a modern assertion framework like AssertJ – and even the old good JUnit can become a very versatile testing tool for both unit- and functional testing.
This demo will show how to use the features of Kotlin to fight the rising complexities of automated test data preparation. The material is based on the real-world experience of using Kotlin for developing and testing backend micro-services (Kotlin or vanilla Java)