Skip to content

Incorrect links in Java docs for classes without packages #1174

Closed
@alisevych

Description

@alisevych

Description

Links in Java docs are starting with '.' if the tested class has no package and is placed in the Sources root.

To Reproduce

  1. Download UnitTestBot plugin from main
  2. Install it in IntelliJ Idea (remove previous)
  3. Open/create a project
  4. Add the following Java class to the Sources root - without package:
public class A {

    public int test(){
        return 1;
    }
}
  1. Generate tests with UnitTestBot... for it
  2. Wait tests are generated

Expected behavior

Links to classes/methods are supposed to be resolved.

Actual behavior

Links to the class / method are starting with '.' and cannot be resolved.
They are displayed red.

Visual proofs (screenshots, logs, images)

The following test class is generated:

image

image

public class ATest {
    ///region Test suites for executable A.test

    ///region FUZZER: SUCCESSFUL EXECUTIONS for method test()

    /**
     * @utbot.classUnderTest {@link .A}
     * @utbot.methodUnderTest {@link .A#test()}
     */
    @Test
    @DisplayName("test: arg_0 = A() -> return 1")
    public void testTestReturnsOne() {
        A a = new A();

        int actual = a.test();

        assertEquals(1, actual);
    }
    ///endregion

    ///endregion
}

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.4 (JBR 11) - 2022.2.3 (JBR 17)

Metadata

Metadata

Assignees

Labels

comp-summariesSomething related to the method names, code comments and display names generationctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions