I have test class that consists of @Before method with some parameters, and other test methods.
@Before
@ParameterizedTest
@ValueSource(strings = {"123", "456"})
public void createData(String userId) {
someMethod(userId)
}
@ParameterizedTest
@ValueSource(strings = {"123", "456"})
public void abc(String userId) {}
but it keeps executing abc() first and throws error
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [java.lang.String arg0] in method [public void tests.xxx.createData(java.lang.String) throws java.io.IOException].
I'm quite new to JUnit Parameters. Can Before method be at the same time ParametrizedTest? Without this annotation [ParametrizedTests] it seems not to work as intended, but on the other hand I need this to execute before all other methods. What might be the issue and what's the solution?