title: Use @ClassRule in Kotlin
body: <p>In JUnit you can use @ClassRule to annotate an static field.
  How can I do this in Kotlin?</p>
  
  <p>I tried:</p>
  
  <pre><code>object companion {
      @ClassRule @JvmStatic
      val managedMongoDb = ...    
  }
  
  and 
  
  object companion {
      @ClassRule @JvmField
      val managedMongoDb = ...    
  }
  </code></pre>
  
  <p>but none of the last works because rule isn't executed.</p>
  
  <p>I double checked that exactly same rule works fine without static context:</p>
  
  <pre><code>@Rule @JvmField
  val managedMongoDb = ...
  </code></pre>