Rules
suggest changeTo 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents