Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import assertTrue is missing #2616

Open
alisevych opened this issue Sep 22, 2023 · 1 comment
Open

Import assertTrue is missing #2616

alisevych opened this issue Sep 22, 2023 · 1 comment
Assignees
Labels
comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support ctg-bug Issue is a bug spec-internal Internal issue

Comments

@alisevych
Copy link
Member

alisevych commented Sep 22, 2023

Description

Junit5 assertTrue is used, but import is missing

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA
  2. Open sm***t project
  3. Generate Unit tests with No configuration tests for Facet
  4. Check generated test

Expected behavior

Generated test should have import of used asserts.

Actual behavior

Generated test is not compiling, assertTrue import is missing.

Screenshots, logs

The following imports are present:

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.utbot.runtime.utils.java.UtUtils.deepEquals;

The following line is present in generated test, that is not compiling:

        assertTrue(deepEquals(arrayList, actual));

Environment

IntelliJ IDEA version - 2023.2 Ultimate
Project - Maven
JDK - 1.8

@alisevych alisevych added ctg-bug Issue is a bug comp-codegen Issue is related to code generator spec-internal Internal issue comp-spring Issue is related to Spring projects support labels Sep 22, 2023
@alisevych alisevych added this to the September Release milestone Sep 22, 2023
@alisevych alisevych removed this from the October Release milestone Sep 26, 2023
@EgorkaKulikov
Copy link
Collaborator

Seems that the problem is in the imports optimizer we currently use. May be we should think about another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support ctg-bug Issue is a bug spec-internal Internal issue
Projects
Status: Todo
Development

No branches or pull requests

3 participants