Skip to content

Variable objectType with Class is used but not created #2422

Open
@alisevych

Description

@alisevych

Description

Variable objectType with Class is used but not created.

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA
  2. Open sm***t project
  3. Press Ctrl+Shift+N, input rdi
  4. Generate tests for all methods of the class with @SpringBootApplication and Unit tests selected

Expected behavior

  1. Variable objectType is initialized with object's class.
    Or Object.class should be used instead.
  2. Assert of finalObjectType is (probably) expected.

Actual behavior

Variable objectType with Class is used to pass the Class of the first object.
finalObjectType is created, but not checked

Screenshots, logs

    ///region OTHER: EXPLICITLY THROWN UNCHECKED EXCEPTIONS for method query(java.lang.Object, java.lang.Class)

    @Test
    public void testQuery1() {
        Object value = new Object();

        assertThrows(IllegalArgumentException.class, () -> rdi.query(value, Object.class));

        Class finalObjectType = objectType;

    }
    ///endregion

Environment

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

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorcomp-springIssue is related to Spring projects supportcomp-symbolic-engineIssue is related to the symbolic execution enginectg-bugIssue is a bug

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions