Hello.
I want to do something similar to 'MockUp' from JMockit but with Mockit/PowerMock.
I want to control the comportment of a method of a class that extends the class i want to test.
But i have one problem that is the method is private, so i think i cant go with Mockito, and need use PowerMock.
The Problem
Class A extends B{...}
Class B {
private Header generateHeaderForServiceCall(c,d,f,g,h,j){...}
}
In my Class ATest{ In @Before i want to mock generateHeaderForServiceCall(.....) for just return a default Header created for me. }
So, using JMockit is like:
new MockUp<Controller>() {
@Mock
private Header generateHeaderForServiceCall(...) {
return defaultHeader;
}
};
* So, can i do with with Mockito?
* Do i need to use PowerMock?
* Can i use Mockito and PowerMockit together?
Thanks