简体   繁体   中英

How do you add PowerMock to your project?

I am using mockito in my project and then found i could not use mockito for static classes and so have been told to download and use powermock. i download from here https://code.google.com/p/powermock/wiki/Downloads , this file specifically. PowerMock 1.6.0 with Mockito and JUnit including dependencies

Do i just need to import the JARs from this into my project library? or is there more to it?

I assume you don't use maven. You just have to add the corresponding powermock version. Take a look to this mapping and choose the right version:

Mockito             PowerMock
1.10+               1.6.0
1.9.5-rc1 - 1.9.5   1.5.0 - 1.5.6
1.9.0-rc1 & 1.9.0   1.4.10 - 1.4.12
1.8.5               1.3.9 - 1.4.9
1.8.4               1.3.7 & 1.3.8
1.8.3               1.3.6
1.8.1 & 1.8.2       1.3.5
1.8                 1.3
1.7                 1.2.5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM