Run JUnit test in IntelliJ IDEA 14 without choosing configuration type

后端 未结 3 1097
北海茫月
北海茫月 2021-02-05 06:01

In IntelliJ IDEA 14 with Gradle plugin I would like to run JUnit test without being asked about configuration type. Problem occurs when I run test for the first time - there is

3条回答
  •  感动是毒
    2021-02-05 06:43

    The Gradle Test Runner configuration looks a bit different in IntelliJ 2019.2 :

    To have Intellij rather than Gradle run your tests when you right-click on the test/Test Class/Test package select IntelliJ IDEA for the "Run tests using:" option.

    Having IntelliJ run your test means that a Junit configuration is created to run the test.

    When I upgraded IntelliJ 2019.1 to 2019.2 I found that the default setting for the Gradle runner was set to 'Gradle' which meant that my unit tests didn't run properly when I right-clicked on a test and selected 'Run' - they just terminated with no results. I had to change the "Run tests using:" option to IntelliJ IDEA

提交回复
热议问题