Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including JUnit 5 dependency in IntelliJ IDEA

From jetbrains blog:

IntelliJ IDEA supports the ability to actually run tests written for JUnit 5 – there’s no need to use the additional libraries (like the Gradle or Maven plugins for example), all you need is to include the JUnit 5 dependency.

I'm new to Java and IntelliJ IDEA and it's not clear to me what are the steps that I should do for making test using Junit 5.

like image 288
Stav Alfi Avatar asked Mar 10 '17 14:03

Stav Alfi


People also ask

Does IntelliJ support JUnit 5?

One of the new features in IntelliJ IDEA 2016.2 is support for the new JUnit 5 testing framework.

Where do I put dependencies in IntelliJ?

Add a new dependencyFrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules | Dependencies. Alt+Insert and select a dependency type: JARs or directories: select a Java archive or a directory from files on your computer.


1 Answers

If your project is Maven or Gradle based, the dependency is added via pom.xml or build.gradle, otherwise you just add the .jar files to the Module Dependencies.

IDE can help you with that, press Alt+Enter on the red code:

add library

The following dependencies will be downloaded from the Maven repository and added to the classpath:

deps

like image 96
CrazyCoder Avatar answered Sep 20 '22 11:09

CrazyCoder