Powermock JUnit tests are taking more time to execute compared to normal JUnit

試著忘記壹切 提交于 2019-12-05 11:34:07

PowerMock is a tool that performs bytecode instrumentation on your generated classes. Once your classes are compiled into Java Bytecode, PowerMock comes along and modifies this generated classes. It is not possible otherwise (by using Java Proxy) to mock a private or a static method.

You should only use @PrepareForTest annotation only in those classes that you want to use features exclusive to PowerMock, such as mocking private or static methods.

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