CoreComponents icon indicating copy to clipboard operation
CoreComponents copied to clipboard

Is there any way to use @Rule with NestedRunner ?

Open tak2siva opened this issue 9 years ago • 3 comments

tak2siva avatar Sep 23 '16 10:09 tak2siva

Which runner do you mean? There are several :)

xkr47 avatar Sep 23 '16 10:09 xkr47

@xkr47 :) edited the question. When I run my tests in Intellij with @RunWith(MockitoJUnitRunner.class) @Rule is working. But when I try with @RunWith(NestedRunner.class) its not honoring the junit rules I've added. What am I missing here ?

tak2siva avatar Sep 23 '16 11:09 tak2siva

This Runner was built a long time ago, and without @Rule support. Maybe you can get away with the new JUnit5 functionality? http://junit.org/junit5/docs/current/user-guide/#writing-tests-nested

Macroz avatar Sep 26 '16 06:09 Macroz