Using Kotlin with JUnit4


Hi there.  :)

I’m just getting into the Kotlin language (just the simpler stuff) and I thought I’d start with converting a few unit tests. I’m using some of the JUnit4 annotations and I seem to have run into one a small problem:


is okay in Java, but I’m not sure how to convert that in Kotlin since I don’t seem to have access to the static class.

Is it possible to do this in Kotlin?


Hang on...

I think I have it.

This might work:


Yep! That did it.