Hi so i tried to build my project by running mvn clean install. Ideally, it'd build successfully since all my other team members can do so fine. It, however, says i'm running into test failures. This is the exact error log given:
Tests run: 22, Failures: 0, Errors: 22, Skipped: 0, Time elapsed: 0.739 sec <<< FAILURE! - in com.pic.resources.xxx() Time elapsed: 0.216 sec <<< ERROR!
org.mockito.exceptions.base.MockitoException:
Failed to release mocks
This should not happen unless you are using a third-part mock maker
at com.pic.resources.xxx.java:50)
Caused by: org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class com.pic.service.xxx.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 1.8
JVM vendor name : AdoptOpenJDK
JVM vendor version : 25.242-b08
JVM name : OpenJDK 64-Bit Server VM
JVM version : 1.8.0_242-b08
JVM info : mixed mode
OS name : Mac OS X
OS version : 10.16
You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.
Underlying exception : org.mockito.exceptions.base.MockitoException: Could not modify all classes [class com.pic.service.xxx]
at com.pic.resources.xxx.setup(xxx.java:50)
Caused by: org.mockito.exceptions.base.MockitoException: Could not modify all classes [class com.pic.service.xxx]
at com.pic.resources.xxx.setup(xxx.java:50)
Caused by: java.lang.IllegalStateException:
Byte Buddy could not instrument all classes within the mock's type hierarchy
This problem should never occur for javac-compiled classes. This problem has been observed for classes that are:
- Compiled by older versions of scalac
- Classes that are part of the Android distribution
at com.pic.resources.xxx.setup(xxx.java:50)
Caused by: java.lang.SecurityException: class "com.bmc.auth.OnBehalfOfAuthenticationDetailsProvider"'s signer information does not match signer information of other classes in the same package
at
I have tried ALL the possible solutions i can think of
- updated my JDK to 11 and changed the jdk version on intellij and pointed mvn to be to JDK 11
- downgraded my JDK to 8 and did same step as 1) and added the right byte-buddy with an older version
- upgraded to latest maven
- cleared cache
- used latest mockito version (then tried old mockito version and nothing happened)
- running this in both intellij and the terminal didn't change anything. Even tried importing the right intellij settings. That didn't work
- added byte-buddy dependency and made it the latest version
The only other possible cause of the problem is that I upgraded my Mac OS to Big Sur the other day and it screwed up my java run time, but I don't know if tht's a cause or not.