Description
Overview
Simple parameter resolution for strings, ints, doubles, longs works in M4, but no longer works in M5 and throws the following exception.
ParameterResolutionException: No ParameterResolver registered for parameter [java.lang.String arg0] in executable
Was previously using M4, upgraded to M5 and issue began occurring.
Example:
@ParameterizedTest (name = "{index} [{arguments}] User Flags CONDITION NAME")
@ValueSource(strings = { "dev", "sit" })
@DisplayName("{index} [{arguments}] User Flags CONDITION NAME")
public void testUseTestScenario(String testEnvironment, TestInfo info, TestReporter testReporter) throws Exception {
}
Do not get a build exception, get a runtime exception with jUnit5 with gradle 3.5 running in Jenkins.
=> org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [java.lang.String arg0] in executable [public void com.orgname.TestSituation.setUpBeforeEach(java.lang.String,org.junit.jupiter.api.TestInfo,org.junit.jupiter.api.TestReporter) throws java.lang.Exception].
JUnit Jupiter:TestSituation:User Flags Situation A:2 [sit] User Flags Situation A
MethodSource [className = 'com.orgname.TestSituation', methodName = 'testSituationA', methodParameterTypes = 'java.lang.String, org.junit.jupiter.api.TestInfo, org.junit.jupiter.api.TestReporter']
=> org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [java.lang.String arg0] in executable [public void com.orgname.TestSituation.setUpBeforeEach(java.lang.String,org.junit.jupiter.api.TestInfo,org.junit.jupiter.api.TestReporter) throws java.lang.Exception].
Related Issues
- ParameterizedTestParameterResolver conflicts with parameterized @BeforeEach #833
- Introduce extension API for accessing arguments passed to tests #1139
- Make invocation index for
@ParameterizedTest
available to test author #1668 - Add ability to access the current repetition of a RepeatedTest from afterEach in a custom Extension #1884
Deliverables
- ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Type
Projects
Status
Todo