Hi all, There's PR https://github.com/apache/pulsar/pull/21385 ready to be merged to master branch. It upgrades Mockito to 5.6.0 version. Mockito API hasn't significantly changed. A few changes were made in master branch to fix the Mockito usage. The newer version is stricter than the previously used version. For example, it's not possible to spy a mock. That doesn't make sense in the first place. Another detail is that ArgumentCaptor now checks types and spots misuse. There were a few locations where incorrect types were passed and that has stopped working in the newer Mockito version. One minor detail is that mockito-inline library no longer exists and that is part of mockito-core. The minimum JDK runtime version is Java 11 for Mockito 5.x . In general this should be safe change. In a CI job where Java 8 runtime is used to run tests, the Mockito version is set to 4.x to allow execution.
Please review https://github.com/apache/pulsar/pull/21385 and provide feedback. -Lari