在工具测试中找不到模拟

时间:2019-10-09 17:36:11

标签: android unit-testing mockito

好的,我可能在这里很傻,但是我无法将Mockito导入我的仪器测试中。 这是我的工具测试类的屏幕快照,根本无法找到模拟包。

Mockito error

这是我完整的build.gradle文件

应用插件:“ com.android.application”

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.trendingrepo"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation "android.arch.work:work-runtime:1.0.1"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation('org.mockito:mockito-android:2.6.3') {
    exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation('org.droidparts.dexmaker:dexmaker:1.5') {
    exclude module: 'objenesis'
}
}

0 个答案:

没有答案