I have set up some tests in my project, that uses Mockito to mock some classes. To run those tests, I use Gradle. When running them locally, everything works and all tests pass. However, for one week now, one test is failing (in the GitLab CI/CD only) with the following exception:
java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.creation.cglib.ClassImposterizer$3
Even when re-running a pipeline on an unmodified branch, the test fails now, while previously it did not.
gitlab-runner 15.0.0
is used for the CI/CD and docker image gradle:7-jdk17-focal
. Mockito version is 1.10.19