JUnit

Other topics

Rules

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.

Contributors

Topic Id: 6973

Example Ids: 23532

This site is not affiliated with any of the contributors.