Does any one know how to tackle this.
@RunWith(SpringJUnit4ClassRunner.class)
@RunWith(Parametrized.class)
@ContextConfiguration("/META-INF/blah-spring-test.xml")
public class BlahTest
..
so i want to have a spring nature test and at the same time want to have it parameterized to avoid code duplication ...
@RunWith(Parameterized. class) functionality. Adding Cucumber into the mix, uses @RunWith(Cucumber. class) and according to Junit you can't have multiple @RunWith options.
Create test suite using annotation @RunWithRight-click on the test source folder and select New -> Other -> JUnit -> JUnit Test Suite. Then, choose the name of the suite and the test classes that will be included in the suite and click Finish.
We can run JUnit 5 tests with any older JUnit environment using the @RunWith annotation.
You can't use two runners as it noted in the commented post. You should use the Parameterized
runner as use Spring's TestContextManager to load the Spring context.
@Before
public void before() throws Exception {
new TestContextManager(getClass()).prepareTestInstance(this);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With