From a144413602b2b302b5c57b409d30903ed79fea01 Mon Sep 17 00:00:00 2001 From: Ivan Morgillo Date: Thu, 7 Apr 2022 12:02:54 +0200 Subject: [PATCH] Add Troubleshooting section to README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I faced a known issue that almost made me switch to Truth 😅 Eventually I found a solution, and I believe it would be useful to others as well. --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 50d4d855..bbe49d9d 100644 --- a/README.md +++ b/README.md @@ -256,3 +256,32 @@ error message. ## Contributing to assertk Contributions are more than welcome! Please see the [Contributing Guidelines](https://github.com/willowtreeapps/assertk/blob/main/Contributing.md) and be mindful of our [Code of Conduct](https://github.com/willowtreeapps/assertk/blob/main/code-of-conduct.md). + +## Troubleshooting + +### I'm seeing a java.lang.NoClassDefFoundError: org/opentest4j/AssertionFailedError + +It might happen that your tests are failing with something like: + +``` +java.lang.AssertionError: java.lang.NoClassDefFoundError: org/opentest4j/AssertionFailedError + + at me.tatarka.open4jideissuetest.ExampleUnitTest.addition_isCorrect(ExampleUnitTest.kt:15) + 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) +[...] +``` + +It's a [known issue](https://youtrack.jetbrains.com/issue/IDEA-214533) and there is a workaround. You can add: + +``` +testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") +``` +or +``` +testImplemetation("org.opentest4j:opentest4j:1.1.1") +``` + +to your `build.gradle*` file 👍