Skip to content

import JUnit5 @Timeout is missing #1982

Open
@alisevych

Description

@alisevych

Description

import JUnit5 @timeout is missing
There is full class name of Timeout annotation used in code: @org.junit.jupiter.api.Timeout instead of short @Timeout

To Reproduce

  1. Run the 'utbot' project in IntelliJ Idea 2022.2.4 Ultimate
  2. Install plugin built from unit-test-bot/rc3102023 branch
  3. Generate JUnit5 tests for CommonMocksExample.doNotMockHashCode()
  4. Open the generated test

Expected behavior

Timeout interface is expected to be imported.
@Timeout annotation is expected to be used by its short name

Actual behavior

Full class name of Timeout annotation is used:
@org.junit.jupiter.api.Timeout
Import is missing.

Visual proofs (screenshots, logs, images)

    @Test
    @DisplayName("doNotMockHashCode: exampleClass = ExampleClass(int)")
    @org.junit.jupiter.api.Timeout(value = 1000L, unit = TimeUnit.MILLISECONDS)
    public void testDoNotMockHashCode1() {
        ...
    }

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.4 Ultimate

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a buglang-javaIssue is related to Java support

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions