Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 11 with Powermock - Are they compatible?

After switching to Java 11, all the powermock related tests (annotated with @RunWith(PowermockRunner.class) and @PowerMockIgnore) are failing.

Is this known issue? I read a relevant SO post which was posted a year ago, and the latest release of Powermock was 2 months ago. I don't see any difference in behaviour with JDK 11.

like image 363
ha9u63ar Avatar asked Oct 16 '25 23:10

ha9u63ar


1 Answers

  1. The existing "mvn hpi:run" command will not work correctly on Java 11 unless Java modules are downloaded and passed to the environment.

  2. List item If you use Mockito/PowerMock in your plugin tests, you may need to update to the recent versions with Java 11 support-

  3. You may also need to add test annotations to workaround PowerMock Issue #864. Example for the Jenkins Core

like image 138
Pallav Khare Avatar answered Oct 18 '25 12:10

Pallav Khare