Mockito + Dexmaker on Android

前端 未结 7 569
余生分开走
余生分开走 2020-12-05 09:42

I am trying to use Mockito in my Android project. I have found very nice tutorial that deals with it: http://www.paulbutcher.com/2012/05/mockito-on-android-step-by-step/

7条回答
  •  清歌不尽
    2020-12-05 10:23

    From @rjath's comment of @MrChaz's answer, this works better for me:

    System.setProperty(
        "dexmaker.dexcache",
        getInstrumentation().getTargetContext().getCacheDir().getPath());
    

    I put it in my setUp() method.

提交回复
热议问题