Remove Powermockito usage in favor of mockito-inline
This is the initial pull https://github.com/apache/bookkeeper/pull/3077
PowerMockito static mocks don't work well with the latest JDK class encapsulation mechanisms. The main problem is that PowerMockito, in order to mock a single static method of a class, try to setAccessible a lot of other apparently related classes. This means, starting from JDK17, you need to add --add-opens to the Java runtime options in order to avoid runtime errors.
PowerMockito development isn't much active and they don't seem to be ready for the new JDK releases. The best replacement is to use mockito-inline (additional part of mockito-core), which uses a different algorithm in order to mock static methods - a lot less invasive.
At the moment we have a dozen of tests in bookkeeper-server module.