Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Parameterized jUnit tests without using Annotation

I am running parameterized jUnit tests by using Annotation @RunWith(Parameterized.class) on my Test class. However now I need to also run my test class using PowerMockRunner and therefore use annotation @RunWith(PowerMockRunner.class). Obviously this is not possible as only one @RunWith annotation is allowed.

How can I implement a parameterized test without using the annotation @RunWith(Parameterized.class) ?

like image 757
Paul Avatar asked Jan 15 '15 10:01

Paul


1 Answers

You can bootstrap PowerMock using a JUnit Rule, so you no longer need the RunWith for that.

https://code.google.com/p/powermock/wiki/PowerMockRule

like image 176
Maarten Winkels Avatar answered Oct 29 '22 02:10

Maarten Winkels