Forum chevron_right Corda Topics chevron_right CorDapp Development chevron_right Having trouble to run Flow test

  • Creator
  • #10195
    qiancheng fan

    I am studying corda and trying to write flow test for my corda app, but when I run the test I have this error:

    “Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
    java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)”

    I do have setted up my environment according to the tutorial and my corda app can compile and run nomally, but it just can not start flow test, any suggestion will be helpful to me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
  • #10206
    Thiago Viana

    It seems to be a problem with the reference/version of mockito and corda. Did you try using a different version? An older or a newer one?

    It would help posting a pice of your code (also the dependence definition).

    qiancheng fan


    qiancheng fan

    Hi, I’m not sure how to change the mockito version, I thought it is included in corda testing library, I tried to change the cordaVersion and cordaCoreVersion in the file:”” to 4.7 and 4.8 but still not work. The current version file is this:

    And the dependency definition here is:
    dependencies {
        testCompile "junit:junit:$junit_version"
        // Corda dependencies.
        cordaCompile "$corda_core_release_group:corda-core:$corda_core_release_version"
        cordaRuntime "$corda_release_group:corda:$corda_release_version"
        testCompile "$corda_release_group:corda-node-driver:$corda_release_version"
        // CorDapp dependencies.
        cordapp project(":contracts")
        // Token SDK dependencies.
        cordaCompile "$tokens_release_group:tokens-money:1.1"
        cordaCompile "$tokens_release_group:tokens-workflows:$tokens_release_version"
    And the code of the test I run is just the template test here:
    It should be my setting's issue but I really have no clue how to fix it.
    Thiago Viana

    Try adding Mockito’s dependency (maybe the latest one):

    Something like this:

    dependencies {

    compile “org.mockito:mockito-core:$mockito_version_number”


    Where $mockito_version_number is actually the version. =D

    qiancheng fan

    I added this and tried many versions but the error is still there. But still thank you for your advice.

    Peter Li


    Hi Qiancheng,

    Unfortuntely I cannot recreate your error, but I look into the dependencies and find a way for you to look at your own project and check if the dependencies were downloaded correctly.

    At the gradle panel (the right side of the IntelliJ), there is a search dependencies button. Click that, and at the top left select the workflows package, then search for Mockito. You should be able to see if the dependencies are successfuly downloaded to your project.

    The mockito denpendencies is included in the node itself, so you should not need to manually add dependencies yourself.


    Peter Li – R3

    qiancheng fan


    I find the mockito-core:2.28.2  dependency at this location: workflows/corda-node-driver:4.9/corda-test-utils:4.9/corda-test-common:4.9/mockito-core:2.28.2

    But it shows a error with hint “conflict with 2.18.3”, this might be the reason why I have this issue but I am not sure how to fix it. Is there any suggestions for that? many thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Subscribe to our newsletter to stay up to date on the latest developer news, tools, and articles.