**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
Activity
alisevych commentedon Jul 29, 2022
As discussed @onewhl @denis-fokin
The short description of the test method should be added as:
remove - for JUnit4 // Java doc has this information
@DisplayName("<short description>")- for JUnit5 - with corresponding import@Test(description = "<short description>")- for TestNGrelated docs: TestNG annotations, JUnit5 DisplayName, JUnit4 - no analogues.
Generate DisplayName annotation only for JUnit 5 #576
Generate DisplayName annotation only for JUnit 5 #576
Generate DisplayName annotation only for JUnit 5 #576 (#624)
Generate DisplayName annotation only for JUnit 5 #576 (#624)
Generate DisplayName annotation only for JUnit 5 #576 (#624)