Skip to content

String.join() with Enum.toString() inside - test generation fails #434

Closed
@alisevych

Description

@alisevych

Description

Test generation fails for String.join() with Enum.toString() inside

To Reproduce

Steps to reproduce the behavior:

  1. IntelliJ IDEA with UTBotJava plugin installed
  2. A project with JDK 8/11 is opened
  3. Add the following class:
public class UsingEnum {

    public void execute() {
        String print = String.join("\n", 
                WorkDays.Monday.toString(), 
                WorkDays.Tuesday.toString());
    }

    public enum WorkDays {
        Monday,
        Tuesday,
        Wednesday,
        Thursday,
        Friday
    }
}
  1. Run Generating tests with UTBot... for this class

Expected behavior

Tests are supposed to be generated.

Actual behavior

"Failed to generate unit tests for class UsingEnum" error popup is shown in IDEA.
It is shown immediately after test generation is started.

Visual proofs (screenshots, logs, images)

String join with Enum toString()

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.3
checked on JDK 8 and 11, Gradle projects - same error

Additional context

Adding some input parameters to the method helps - fuzzer is generating tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ctg-bugIssue is a bug

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions