@RunWith(MockitoJUnitRunner.class)
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"mocked_spring_tests.xml"})
public class MyTests
...
I played around with writing my own Runner implementation that delegated to the Spring and Mockito runners, but it was more complex than I anticipated. It's certainly possible, but personally was too difficult for me. So I just use the Spring runner and make due without the Mockito annotations.
Did u get any solution to this, please email me - ramachandra.bhatt@gmail.com
ReplyDeletewas it possible to have the same annotation multiple times in the same class?
ReplyDeleteI played around with writing my own Runner implementation that delegated to the Spring and Mockito runners, but it was more complex than I anticipated. It's certainly possible, but personally was too difficult for me. So I just use the Spring runner and make due without the Mockito annotations.
ReplyDeleteIf this requirement is specific to Mockito, you can try Powermock which allows to use mockito runners withour @Runwith annotation
ReplyDeleteSee http://stackoverflow.com/questions/2454473/junit-parameterized-tests-together-with-powermock-how