qbicsoftware / core-utils-lib

Library containing core classes and utilities that are independent of a portal.
MIT License
0 stars 0 forks source link

Tests fail due to not being able to inizialize interface org.mockito.plugins.MockMaker #40

Closed wow-such-code closed 3 years ago

wow-such-code commented 3 years ago

39

Expected behaviour

Tests are run and show failure or not dependent on return values.

Observed behaviour

Tests fail because the initialization of a testing interface fails:

java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker
...
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@1554909b
    at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:55)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:63)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:48)
    at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:17)
    at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:14)
    at org.mockito.junit.MockitoJUnit.rule(MockitoJUnit.java:35)
    at life.qbic.cli.ToolExecutorTest.<init>(ToolExecutorTest.java:51)

Steps to reproduce

Run mvn test or have a look at Github actions.

jenniferboedker commented 3 years ago

Solved with 6a1fb0c

The powermock-module-junit4 with version 2.0.7 conflicted with powermock-api-mockitos version 1.7.4. To solve the problem powermock-api-mockito2 was required and powermock-module-junit4 was downgraded to 1.7.4