Mockito asks to add @PrepareForTest for the class even after adding @PrepareForTest

Make sure you add @RunWith(PowerMockRunner.class) to the top of your class as well.

::edit:: two years later…

Don’t ever use PowerMockito, you shouldn’t need to.

If you do need to, you have most likely broken the SOLID principles and your design is wrong.

Fix your design instead.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)