PowerMock & Java 11

吃可爱长大的小学妹 提交于 2019-12-01 00:54:43

问题


We are using PowerMock in few of our historical projects. Unfortunately PowerMock is quite dead and is not compatible with Java 11.

And we are using mockStatic(). Yes, we know its considered harmful - its in the legacy code and we would prefer not to rewrite those classes now...

Are there any options how to tweak PowerMock to support Java 11? Or is it possible to easily replace it with some other Java 11 compatible framework? (Mockito does not support mockStatic)


回答1:


After one year of no releases, things are really moving in PowerMock.

PowerMock 2.0.0-RC1 was released. And with PowerMockito 2.0.0-RC1 + @PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "org.w3c.*"})

The tests work under Java 11.



来源:https://stackoverflow.com/questions/52966897/powermock-java-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!