reportportal / agent-java-cucumber6

Cucumber JVM version [6.0.0; ) adapter
Apache License 2.0
9 stars 5 forks source link

NoSuchMethodError: okhttp3.OkHttpClient$Builder.callTimeout when running test cases #38

Closed Phalguna2125 closed 1 year ago

Phalguna2125 commented 1 year ago

Is cucumber-java :7.12.1 supported by agent-java-cucumber6? I see in the docs its supported till 7.0.0 of cucumber-java and junit.

I am using agent-java-cucumber6:5.2.0 along with cucumber-java 7.12.1. When running cases with ScenarioReporter as plugin along with cucumber -java I am facing issue of following error. Could you let me know whats the issue


Caused by: java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder.callTimeout(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder
       at com.epam.reportportal.service.ReportPortal$Builder.defaultClient(ReportPortal.java:542)

       at com.epam.reportportal.service.ReportPortal$Builder.lambda$buildClient$1(ReportPortal.java:430)

       at java.base/java.util.Optional.orElseGet(Optional.java:369)

       at com.epam.reportportal.service.ReportPortal$Builder.buildClient(ReportPortal.java:430)

       at com.epam.reportportal.service.ReportPortal$Builder.build(ReportPortal.java:407)

       at com.epam.reportportal.cucumber.AbstractReporter.buildReportPortal(AbstractReporter.java:193)

       at com.epam.reportportal.cucumber.AbstractReporter.<init>(AbstractReporter.java:90)

       at com.epam.reportportal.cucumber.ScenarioReporter.<init>(ScenarioReporter.java:49)

       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

       at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

       at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

       at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

       at io.cucumber.core.plugin.PluginFactory.newInstance(PluginFactory.java:116)

       ... 65 more
HardNorth commented 1 year ago

@Phalguna2125 Hi, I double-checked binary compatibility of the latest OkHttp3 of version (4.11.0) with Report Portal agents and it works perfectly fine, so your issue is related to an old version of the library, which is coming from dependencies of your project. So I would strongly recommend to update such dependency, since we monitor our dependencies for vulnerabilities.

I have to say, that your project is your zone of responsibility, so the issue is not related to Report Portal team.

Phalguna2125 commented 1 year ago

Thanks @HardNorth