Could not initialize plugin: interface org.mockito.plugins.MockMaker

后端 未结 25 2083
走了就别回头了
走了就别回头了 2020-12-29 01:01

I\'m getting following exception once tests is started:

    Testcase: treeCtorArgumentTest(com.xythos.client.drive.cachedtree.CachedTreeTest):  Caused an ERR         


        
25条回答
  •  别那么骄傲
    2020-12-29 01:25

    Adding a bnd aspect to this

    Adding on to Paskas' answer, you also have to include the dependencies in the cnf maven repository, if you're using one (like my cnf/central.mvn).

    org.mockito:mockito-core:2.21.0
    net.bytebuddy:byte-buddy:1.8.15
    net.bytebuddy:byte-buddy-agent:1.8.15
    org.objenesis:objenesis:2.6
    

    and for convenient referencing, you can include a bnd variable in your cnf/build.bnd

    mockito: org.mockito:mockito-core; version=2.21.0,\
             net.bytebuddy:byte-buddy; version=1.8.15,\
             net.bytebuddy:byte-buddy-agent; version=1.8.15,\
             org.objenesis:objenesis; version=2.6
    

    and in your project's bnd file

    -testpath:\
        ${mockito}
    

提交回复
热议问题