Usage of companion object is the proper way: companion object { @BeforeClass @JvmStatic fun setupClass() { // your class level setup logic here } } Remember that @BeforeClass is static and is executed before you have test object instance. There's no other way. If you want to have access to the injected variable you should do your logic in @Before method which is executed before each @Test method. @Before fun setup() { // your setup logic here }