Я сталкиваюсь с ошибкой при попытке использовать Serenity BDD с JBehave и Rest-Assured. В частности, я получаю следующие ошибки, когда сценарий JBehave отправляет запрос через RestAssured:
@Given("The standalone Rest-Assured")
//succeeds
public void rest_assured_standalone() {
resp = RestAssured.given().get("https://randomuser.me/api/");
}
@Given("The Serenity Rest-Assured")
//fails
public void rest_assured_serenity() {
resp = SerenityRest.given().get("https://randomuser.me/api/");
}
Сгенерирована следующая ошибка:
java.lang.ExceptionInInitializerError
at net.serenitybdd.rest.utils.RestDecorationHelper.decorate(RestDecorationHelper.java:20)
at net.serenitybdd.rest.SerenityRest.given(SerenityRest.java:220)
at objectPackage.RestOperation.loginOperation(RestOperation.java:18)
at classPackage.Login.loginServer(Login.java:24)
at testPackage.steps.loginToServer(steps.java:58)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:790)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:349)
Caused by: java.lang.IllegalArgumentException: Cannot resolve ambiguous delegation of public io.restassured.specification.ResponseSpecification io.restassured.specification.ResponseSpecification.root(java.lang.String) to net.bytebuddy.implementation.bind.MethodDelegationBinder$MethodBinding$Builder$Build@969b7745 or net.bytebuddy.implementation.bind.MethodDelegationBinder$MethodBinding$Builder$Build@5b1bfc25
Примите во внимание любые решения для устранения этих ошибки!