Skip to content

Conflict in users and junit names leads to compilation errors #1038

Closed

Description

@EgorkaKulikov

To Reproduce

Run UtBot via plugin on the following class

public class Test {
    public boolean foo(boolean b) {
        return !b;
    }
}

Generated tests looks like

@Test
  @DisplayName("foo: return !b : False -> return !b")
  public void testFoo_NotB() {
      Test test = new Test();

      boolean actual = test.foo(true);

      assertFalse(actual);
  }

Actual behavior

This code does not compile because Test as a name of the class conflicts with a name from JUnit imports org.junit.jupiter.api.Test

Activity

  1. added
    ctg-bug
    comp-codegen
    on Sep 30, 2022
  2. moved this from Todo to Done in UTBot Javaon Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp-codegenctg-bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions