I have an InstrumentedTest class like this:
@RunWith(AndroidJUnit4::class)
class MyInstrumentedTest {
@Inject
private lateinit var myVar:MyType
@BeforeClass
fun method(){
with(myVar){
...
This gives an error because method must be static. If I put the @BeforeClass method inside a companion object and annotate with @JvmStatic, the injected myVar can't be used. Is there a more proper way to use the @BeforeClass using kotlin, in gereral and in this situation?