Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run JUnit test in IntelliJ IDEA 14 without choosing configuration type

Tags:

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 no configuration for this run. I never run tests with Gradle in IDE so it would be acceptable to disable running test with Gradle. How to run JUnit test directly?

IntelliJ IDEA 14 - run test

like image 669
Marcin Avatar asked Jan 15 '15 20:01

Marcin


People also ask

How do I create a JUnit test case automatically in IntelliJ?

Right-click the test root folder or package in the test root folder in which you want to create a new test and select New | Java Class. Name the new class and press Enter . Press Alt+Insert and select Test Method to generate a new test method for this class. Name the new method and press Enter .


1 Answers

You can get rid of this annoying by adding

idea.gradle.prefer.idea_test_runner=true 

to idea.properties file located in the bin directory of the IntelliJ IDEA installation. Then restart IDEA and enjoy.

like image 55
mihijs Avatar answered Sep 21 '22 23:09

mihijs