运行Testcase Corda enterprise 3.1时找不到类

时间:2018-10-24 08:46:43

标签: java corda

我正在尝试按照corda Enterprise提供的回购更新依赖项,但是在尝试清理构建时却出现以下错误:

java.lang.NoClassDefFoundError: org/mockito/stubbing/Answer
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)

这些是我在gradle文件中提供的依赖项:

 cordaCompile "$corda_release_group:corda-core:$corda_release_version"
    cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
    cordaCompile "$corda_release_group:corda-jackson:$corda_release_version"
    cordaCompile "$corda_release_group:corda-rpc:$corda_release_version"
    cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"

    cordaRuntime "$corda_release_group:corda:$corda_release_version"
    testCompile "$corda_release_group:corda-test-utils:$corda_release_version"
    testCompile "$corda_release_group:corda-node-driver:$corda_release_version"

    testCompile "$corda_release_group:corda-test-common:$corda_release_version"

    testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"


    // CorDapp dependencies
    // Specify your cordapp's dependencies below, including dependent CorDapps
    cordapp "$corda_release_group:corda-finance:$corda_release_version"

Apples-MacBook-Pro:ct-market manish.kumar1$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

1 个答案:

答案 0 :(得分:0)

您需要在您的build.gradle文件的“ dependencies”块中将Mockito添加为依赖项:

dependencies {

    ...

    compile "org.mockito:mockito-core:$mockito_version"

    ...

}