Rules

suggest change

To add a JUnit rule to a test fixture:

@Rule @JvmField val myRule = TemporaryFolder()

The @JvmField annotation is necessary to expose the backing field with the same visibility (public) as the myRule property (see answer). JUnit rules require the annotated rule field to be public.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents