因此,从Androidp开始,可以模拟UI/Espresso测试的最终类。太棒了
经过一些研究,我使用com.linkedin.dexmaker:dexmaker-mockito-inline-extended
来模拟期末课程。
然而,它使用了旧版本的mockito(在撰写本文时为2.28.0
(,而mockito最近发布了3.15.13
版本。
到目前为止,我还可以使用旧版本的Mockito,直到我在后来的版本中偶然发现了解决的问题。
以下渐变配置:
androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito-inline-extended:2.28.0"
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
androidTestImplementation "org.mockito:mockito-android:3.5.13"
在编译时产生此错误:
发现多个文件的操作系统独立路径为"mockito extensions/org.mockito.plugins.MockMaker".
我相信我知道这意味着一些依赖项使用相同的依赖项。我尝试使用exclude,但没有成功。
有人知道如何解决这个问题吗?谢谢你的帮助!
删除androidTestImplementation "org.mockito:mockito-android:3.5.13"
对我来说很好。他们的github有问题https://github.com/linkedin/dexmaker/issues/149