Unit tests with Mockito

Hello,
Yes you can switch your tests on J2SE VM with another Easyant plugin. By default your application uses the com.is2t.easyant.plugins#microej-testsuite Easyant plugin, which executes the tests on the MicroEJ VM. There is another test plugin in the SDK to execute the tests on a J2SE VM : com.is2t.easyant.plugins#microej-junit
So you must disable the first one and enable the second one. You can do this by adding these 2 lines in your module.ivy file:

<ea:plugin org="com.is2t.easyant.plugins" module="microej-junit" revision="1.0.+"/>
<ea:property name="skip.com.is2t.easyant.plugins#microej-testsuite;[3.3.0-RC0,4.0.0-RC0[" value="true" />

Easyant requires to know the declared version of the plugin to disable it, here [3.3.0-RC0,4.0.0-RC0[ is the version of the plugin for the SDK 5.4. You can find this version in your Ivy cache for example, in the file com.is2t.easyant.buildtypes/build-microej-javalib/ants/build-microej-javalib-x.y.z.xml, on the line:

<ea:import mrid="com.is2t.easyant.plugins#microej-testsuite;{version}"/>

Then you can add junit and mockito dependencies in your module.ivy file (assuming the mockito library is available in your modules repository), for example:

<dependency org="junit" name="junit" rev="4.12" conf="test->default" />
<dependency org="org.mockito" name="mockito-core" rev="3.5.11" conf="test->default" />

and start writing your tests with Mockito.

Hope this helps.
Regards