PowerMock Mockito static methods
Posted
by
anergy
on Stack Overflow
See other posts from Stack Overflow
or by anergy
Published on 2011-01-31T13:46:32Z
Indexed on
2011/02/01
15:25 UTC
Read the original article
Hit count: 530
Do we need to mock all static methods of a class when using PowerMock (with Mockito)? I mean, suppose we have:
class MockMe {
public static MockMe getInstance(){
//return new Instance via complex process;
}
public static List<X> anotherStaticMethod(){
// does xyz
}
}
My question, if I need to mock getInstance method, is it necessary to mock "anotherStaticMethod" as well?
PowerMock version:1.3, Mockito version:1.8
© Stack Overflow or respective owner