How to set up Mockito for Kotlin and Android
You need to add the following dependencies in your app's build.gradle:
dependencies {
// ... more entries
testCompile 'junit:junit:4.12'
// required if you want to use Mockito for unit tests
testImplementation 'org.mockito:mockito-core:2.24.5'
// required if you want to use Mockito for Android tests
androidTestImplementation 'org.mockito:mockito-android:2.24.5'
}
And click on sync
You may need another dependency:
androidTestCompile 'org.mockito:mockito-android:2.12.0'
Alternatively, you can try manually importing the annotations:
import static org.mockito.Mockito.*;
It could be that it didn't import properly and that's why it showed as an unresolved reference. Auto-import has its flaws