Skip to content

TestNG parametrized test generation broken #2384

@tyuldashev

Description

@tyuldashev

Description
When user tries to generate parametrized tests with TestNG test framework then no correct tests are generated, but only with internal errors.

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA (used 2023.7.4765)
  2. Generate parametrized tests with TestNG for some code, for example simple:
public class Simple {
    public int div(int a, int b) {
        return a / b;
    }
}

Expected behavior
Some tests which could be executed are created.

Actual behavior
One broken test is generated:

    ///region Errors report for div

    public void testDiv_errors() {
        // Couldn't generate some tests. List of errors:
        // 
        // 1 occurrences of:
        // Expected primitive, string, null or CgExpression, but got: class java.util.Collections$SingletonList

    }
    ///endregion

Environment

IntelliJ IDEA version - 2023.1.3
JDK - 11+

Additional context
That's not reproducible on the latest plugin release - 2023.3, so consider this as regression error.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions