Skip to content

Generated tests contain JUnit4 @Test and commented JUnit5 @DisplayName annotations #576

Closed
@alisevych

Description

@alisevych

Description

Tests generated with JUnit4 framework selected - contain JUnit4 @test and commented JUnit5 @DisplayName annotations.

To Reproduce

Steps to reproduce the behavior:

  1. IntelliJ IDEA with UTBot plugin installed is opened
  2. Open a project with JDK 8-11
  3. Open a public class with a public method
  4. Use plugin to generate tests with JUnit4 test framework selected

Expected behavior

Only JUnit4 annotations are supposed to be used.

Actual behavior

@org.junit.jupiter.api.DisplayName are present, though commented

Visual proofs (screenshots, logs, images)

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class BinarySearchTest {
...
    @Test
    //@org.junit.jupiter.api.DisplayName("rightBinSearch: array = long[10], key = 0L -> return 10")
    public void testRightBinSearchReturns10WithNonEmptyPrimitiveArrayAndCornerCase() {
...

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.3
UTBot plugin version: https://github.com/UnitTestBot/UTBotJava/actions/runs/2717703384

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions