How can I use JUnit rules in Kotlin? The naive solution does not work:
Rule public val folder: TemporaryFolder = TemporaryFolder()
It fails with an error: org.junit.internal.runners.rules.ValidationError: The @Rule 'folder' must be public.
There seems to be no way to create an annotated field or am I missing something?
P.S. What exactly gets annotated here? The getter, the setter, the backing field, or all of them?