We have a repository with a mockito library "org.mockito:mockito-inline:4.11.0" defined in build.gradle. I changed it to "org.mockito:mockito-core:5.14.2".
I ran the unit tests locally in IntelliJ with JDK 17 and gradle, and all the tests passed. However, when the repository was built in Jenkins ( which also uses JDK 17), a lot of tests failed with the following exception.
What could be the reason that it is failing only in Jenkins? Before the change, all the tests passed both locally and in Jenkins.
It seems like Jenkins resolved a different version of Byte Buddy. Try to define an explicit dependency with the latest version.