I would like to use the features of both Arquillian and PowerMock in the same JUnit 4 test.
The problem is that both products are JUnit Runner
s which should be used with @RunWith
, and this is not possible to use multiple @RunWith
on the same test class, or to put multiple Runner
s class in the same @RunWith
annotation.
Do you know any way to do that ?
JUnit4 only supports one @RunWith annotation, and JUnit4's @RunWith annotation doesn’t accept multiple runners.
Reference: project13
You can use PowerMock without using the runner if you use the PowerMockRule (which is a TestRule). From the PowerMockRule:
See also the answers to Junit Parameterized tests together with Powermock - how? and the following thread in the PowerMock google group: Using PowerMock without the RunWith?.
No, you either need to: