nicoloboschi opened a new issue, #3257:
URL: https://github.com/apache/bookkeeper/issues/3257

   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](https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#48)
 (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. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to