Closed
Description
Description
Inconsistent DisplayName is generated for a Collection used as the only parameter.
For example: @DisplayName("setParam: and others")
To Reproduce
Steps to reproduce the behavior:
- Open IntelliJ Idea 2022.1.4 with one of the latest UTBotJava installed
- Add the following class - a Collection is the only input parameter of the method
import java.util.List;
public class CheckFinalSet {
private List<String> resource;
public void setParam( List<String> param) {
this.resource = param;
}
}
- Generate JUnit5 tests with "Not parametrized" option
- Check the generated test
Expected behavior
DisplayName should contain a consistent text about the parameters
Actual behavior
DisplayName contains the following text:
"setParam: and others"
Visual proofs (screenshots, logs, images)
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
import java.util.TreeMap;
public class CheckFinalSetTest {
///region Test suites for executable CheckFinalSet.setParam
///region
@Test
@DisplayName("setParam: and others")
public void testSetParam() {
CheckFinalSet checkFinalSet = new CheckFinalSet();
TreeMap param = new TreeMap();
checkFinalSet.setParam(param);
}
///endregion
///endregion
}
Environment
Windows 10 Pro
IDEA 2022.1.4
JDK 8
Additional context
Same text in annotation is generated for with Set, List, Map - used as the only parameter.
If another parameter (String, int, etc.) the text contains the part before "and".
For instance:
@DisplayName("setParam: n > 0 and others")
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done