I'm trying to write a test based on just testCompile group: 'io.mockk', name: 'mockk', version: '1.7.15'
but in the code below:
import io.mockk.every
import io.mockk.any
import io.mockk.Runs
import io.mockk.impl.annotations.MockK
import io.mockk.junit5.MockKExtension
@ExtendWith(MockKExtension::class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
internal class ConfigDistributorTest {
@MockK
lateinit var configService: ...
@MockK
lateinit var centralisedConfigRegisterService: ...
val configDistributor = ConfigDistributor(centralisedConfigRegisterService, configService)
@Test
fun shouldDistributeConfigToComponents(){
every {
configService.readConfig(any())
} just Runs
}
}
although Runs
, MockK
and MockKExtension
are successfully imported,
the every
and any()
are not available. Is io.mockk.any
the correct import statement and which other dependency is required to use them?