运行serenity测试用例时获取java.lang.AbstractMethodError

问题描述 投票:0回答:1

__在运行宁静时获取以下错误 - 在gradle中重新确定测试用例。在build.gradle中添加是否缺少任何依赖项?

java.lang.AbstractMethodError: net.serenitybdd.rest.decorators.request.RequestSpecificationDecorated.getDefinedFilters()Ljava/util/List;

at net.serenitybdd.rest.utils.RestReportingHelper.recordRestSpecificationData(RestReportingHelper.java:47)
at net.serenitybdd.rest.utils.RestReportingHelper.registerCall(RestReportingHelper.java:67)
at net.serenitybdd.rest.decorators.request.RequestSpecificationDecorated.execute(RequestSpecificationDecorated.java:263)
at net.serenitybdd.rest.decorators.request.RequestSpecificationDecorated.get(RequestSpecificationDecorated.java:48)
at net.serenitybdd.rest.decorators.request.RequestSpecificationDecorated.get(RequestSpecificationDecorated.java:27)
at com.trimble.tts.bolt.steps.SampleSteps.searchCountryByCode(SampleSteps.java:16)
at com.trimble.tts.bolt.tests.SampleTests.verifyThatWeCanFindUnitedStatesOfAmericaCountryUsingTheCodeUS(SampleTests.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at net.serenitybdd.junit.runners.SerenityStatement.evaluate(SerenityStatement.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at net.serenitybdd.junit.runners.SerenityRunner.performRunChild(SerenityRunner.java:471)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:446)
at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:55)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:252)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
[main] ERROR net.serenitybdd.core.Serenity -

希望这是依赖问题,这是我的build.gradle依赖部分。

  dependencies {
         testCompile group: 'junit', name: 'junit', version: '4.12'
        testCompile 'org.testng:testng:6.9.4'
        testCompile 'org.apache.httpcomponents:httpclient:4.5.6'
        testCompile 'io.rest-assured:rest-assured:3.1.0'
        //compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'
        testCompile 'com.google.code.gson:gson:2.8.2'
        testCompile group: 'org.json', name: 'json', version: '20090211'
         testCompile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.6'
        testCompile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
        testCompile group: 'org.apache.poi', name: 'poi', version: '3.9'
        testCompile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
        testCompile group: 'net.serenity-bdd', name: 'serenity-core', version: '1.5.3'
        testCompile group: 'net.serenity-bdd', name: 'serenity-junit', version: '1.5.3'
        // testCompile group: 'net.serenity-bdd', name: 'serenity-gradle-plugin', version: '1.8.12'
        testCompile group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: '1.5.3'
        testCompile group: 'net.serenity-bdd', name: 'serenity-cucumber', version: '1.1.5'
        testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
        testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'


    }

任何直接的帮助将受到高度赞赏。提前致谢

build.gradle
1个回答
0
投票

它的工作原理,当我添加放心版本为'3.0.0'时。宁静1.5+与放心的'3.1.0不相容;

© www.soinside.com 2019 - 2024. All rights reserved.