How to disable jMockit instance for specific Robolectric tests?

many of my Android device tests are written using Robolectric, but this is very limiting, and I want to use jMockit for some tests.

the problem is that the Robolectric test drive fails when jMockit instantiates the classes.

I found out that you can tell jMockit to create instances of only annotated classes by setting the system property "jmockit-mockParameters" to "annotated" - http://code.google.com/p/jmockit/source/detail?r=2066

I use Intellij IDEA and added to the configuration parameters of the test run virtual machine -Djmockit-mockParameters=annotated , but it does not work.

How can I set this system property correctly?

+4
source share

Source: https://habr.com/ru/post/1444173/


All Articles