A New Way to Manage JUnit Test State in Kotlin

I’ve never really liked JUnit’s fixture model. For simple tests it is fine, but combining the definition of the test state with the definition of the test functions in a class leads to scope and lifecycle issues if we want to reuse either.

In this video I show a way of separating the concerns that uses Kotlin’s ability to use multiple receivers to access the fixture state as if they were members of the test class.


submitted by /u/dmcg
[link] [comments]