In my unit tests, I use both TwiP and PowerMock. Both are great tools, but both require the test to be run with their own runner, su开发者_如何学Goch as this:
@RunWith(PowerMockRunner.class)
public class MyTest {
…
}
Is it possible – and if so, how – to combine the two? Perhaps by creating a custom runner or something along the lines.
Yes this is possible, check out the PowerMock rule.
精彩评论