I'd like to create @Rule
to be able to do something like this
@Test public void testValidationDefault(int i) throws Throwable {..}
Where i is parameter passed to the test by @Rule
.
However I do get
java.lang.Exception: Method testValidationDefault should have no parameters
is there any way to bypass it and set the i parameter in the @Rule
?
@Rule
a JUnit provided annotation? Where is it supposed to be put? – Skelton@RunWith(JUnitParamsRunner.class)
before my test class name. Then, I got the error you got -java.lang.Exception: Method testMethod should have no parameters
. – Jeffcott