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

java.lang.NoClassDefFoundError: Could not initialize class sample after adding dependency #352

Open
nesies opened this issue Nov 21, 2023 · 0 comments

Comments

@nesies
Copy link

nesies commented Nov 21, 2023

test repo: https://github.com/nesies/camunda-test-assert-coverage-mockito

i added the mockito dependency:

    <version.camunda_mockito>7.20.0</version.camunda_mockito>
   ...
   <dependency>
      <groupId>org.camunda.community.mockito</groupId>
      <artifactId>camunda-platform-7-mockito</artifactId>
      <scope>test</scope>
      <version>${version.camunda_mockito}</version>
    </dependency>

when i run my tests (which are working without mockito):

NFO] Running sample.camunda.unittest.sampleTest
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.269 s <<< FAILURE! - in sample.camunda.unittest.sampleTest
[ERROR] testSampleSuccess  Time elapsed: 0.005 s  <<< ERROR!
java.lang.ExceptionInInitializerError
        at sample.camunda.unittest.sampleTest.<clinit>(sampleTest.java:21)
Caused by: java.lang.NoClassDefFoundError: kotlin/enums/EnumEntriesKt
        at sample.camunda.unittest.sampleTest.<clinit>(sampleTest.java:21)
Caused by: java.lang.ClassNotFoundException: kotlin.enums.EnumEntriesKt
        at sample.camunda.unittest.sampleTest.<clinit>(sampleTest.java:21)

[ERROR] testSampleWithCallSuccess  Time elapsed: 0 s  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class sample.camunda.unittest.sampleTest
        at sample.camunda.unittest.sampleTest.<clinit>(sampleTest.java:21)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   sampleTest.testSampleSuccess » ExceptionInInitializer
[ERROR]   sampleTest.testSampleWithCallSuccess » NoClassDefFound Could not initialize cl...
[INFO]
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
```

the ligne 21 is:

@ExtendWith(ProcessEngineCoverageExtension.class)
public class sampleTest {
static ProcessEngineCoverageExtension extension = ProcessEngineCoverageExtension.builder().build(); <======
static public ProcessEngine processEngine;

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

No branches or pull requests

1 participant