The @Rule > must be public ValidationError in Kotlin Junit test
The solution is to apply @Rule annotation to property getter:
@get:Rule
val htmlManager = HtmlManager()
more detail here: https://kotlinlang.org/docs/reference/annotations.html#java-annotations
see the fixed test case code here in my open-source project: https://github.com/appham/Sharemarks/commit/310c115d5a820be900abc321cc061aeab7af2e5a#diff-5e1e851ef5b9bb333abb96dec3199a94
You can also use the @JvmField
annotation
@Rule @JvmField
val htmlManager = HtmlManager()