mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.11k stars 202 forks source link

java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null) #344

Closed snazhmudinov closed 5 years ago

snazhmudinov commented 5 years ago

I'm trying a very simple test case, and getting the error.

My gradle dependecy includes: androidTestImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'

This is my test class:

`@RunWith(AndroidJUnit4::class) class ExampleInstrumentedTest {

lateinit var viewModel: ViewModel
lateinit var repository: Repository

@Before
fun setup() {
    repository = mock()
    viewModel = ViewModel(repository)
}

@Test
fun sampleTest() {
    assert(true)
}

}`

snazhmudinov commented 5 years ago

I also have MockMaker file configured and placed in src/androidTest/resources/mockito-extension/org.mockito.plugins.MockMaker

nhaarman commented 5 years ago

This is something core related. Could you file it with the Mockito core project?