Skip to content

Keep names of parameters in the parametrized test #621

Closed
@alisevych

Description

@alisevych

Description

IntelliJ IDEA is generating default Gradle project with separate jupiter-api and jupiter-engine dependencies.
For compiling JUnit5 parametrized tests jupiter-params dependency is needed.

To Reproduce

Steps to reproduce the behavior:

  1. Run IntelliJ IDEA with UTBot plugin installed
  2. Open a project with JDK8/11 and some class inside, for example:
public class StringIndent {

    public void stringNewMethod(String text, char c, int i) {

        if (text.charAt(i) == c) {
            System.out.println("found");
        }
    }
}

  1. Generate parametrized tests for a method with parameters

Expected behavior

Parameters in the generated parametrized test must have the same names as in the initial method:

                                                     String text,
                                                     char c,
                                                     int i,

Actual behavior

Parameters in the generated parametrized test have names like <type_name>N :

                                                     String string,
                                                     char char1,
                                                     int int1,

Visual proofs (screenshots, logs, images)

image

Environment

Windows 10 Pro
IDEA Ultimate 2022.1.4
JDK 11

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions