In order to run tests on JDK 21, Mockito needs to be updated to 5.x. See relates notes on 5.0.0.