Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jGiven html report generation failure - incompatible with openAPIGenerator #947

Closed
manoj-fd opened this issue Sep 5, 2022 · 3 comments · Fixed by #952
Closed

jGiven html report generation failure - incompatible with openAPIGenerator #947

manoj-fd opened this issue Sep 5, 2022 · 3 comments · Fixed by #952

Comments

@manoj-fd
Copy link

manoj-fd commented Sep 5, 2022

I am trying to run jGiven test with version 1.2.2 and Gradle 7.4.2, encountering below issue while html report generation. Error

**Execution failed for task ':service:jgivenAcceptanceTestReport'.

Class com.tngtech.jgiven.impl.util.FilePredicates$1 does not implement the requested interface java.util.function.Predicate**

Note - if i remove openapi-generator related task, the report generation works fine
build.gradle file

dependencies {
classpath "com.tngtech.jgiven:jgiven-gradle-plugin:1.2.2"
classpath "org.openapitools:openapi-generator-gradle-plugin:6.0.0"
}

subproject{
dependencies {
testImplementation 'com.tngtech.jgiven:jgiven-junit:1.2.2'
testImplementation 'com.tngtech.jgiven:jgiven-core:1.2.2'
testImplementation 'com.tngtech.jgiven:jgiven-html5-report:1.2.2'
}

apply plugin: 'com.tngtech.jgiven.gradle-plugin'
acceptanceTest.finalizedBy jgivenAcceptanceTestReport

}

@manoj-fd manoj-fd changed the title compileJava Task failure with jGiven Gradle version 1.2.2 jGiven html report generation failure - incompatible with openAPIGenerator Sep 6, 2022
@l-1squared
Copy link
Collaborator

Dear manoj,
first off, sorry for not reaching out to you sooner. Unfortunatley I was sick and did not have the capacity to look after JGiven.

Concerning your issue: This is really odd. My first guess would be that the openapi package overwrites something important on the classpath. However, I am unsure why this would break a java util dependency of all things.

I'll try to reproduce the issue.

As an aside, have you tried updating the gradle version? We once encountered strage errors, when using an outdated one.

@l-1squared
Copy link
Collaborator

Well, turns out that "FilePredicate$1" indeed does not implement java.util.function.Predicate. (we still used googles functional api within a Stream here. (see PR).
I still don't know why the presence of openapo off all things makes the build fail, though.
I still need to verify that we actually fix the issue with the change and then I will release an update

@l-1squared l-1squared linked a pull request Sep 9, 2022 that will close this issue
@l-1squared
Copy link
Collaborator

After analyzing this waaay to thoroughly, I actually think that the following happens:
We use google.guava function, which was changed (addition of an annotation between v30 and v31). We compiled it with v30. Now the addition of the openapi-tools to the classpath replaces that by a version 31 (here is the biggest hole, because the openapi tools pom states that they are using v30 as well...) of guava. Since the bytecode changed, we get an IncompatibleClassChange error in the presence of of openapi and openapi only.

Why do I prefer this explanation to my previous one? 1.) Everything worked without openapi, 2.) The current master produces a green build 3.) The descritpion for the error type IncompatibleClassChangeError states that this error happens when a class definition changed between compile and runtime.

Anyhow, I will merge the PR and then produce a new release in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants