O'Reilly logo

IntelliJ IDEA Essentials by Jarosław Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the test

To create the unit test for your class, choose Test from the Navigate menu. Alternatively, you can use the Ctrl + Shift + T (PC) or cmd + Shift + T (Mac) keyboard shortcut. If the class you have open in the editor doesn't have any unit tests, the Create New Test dialog box will pop up asking you to create one as shown here:

Creating the test

Depending on the plugins installed, the Testing library list will differ. Select the desired library from the list. The libraries for JUnit and TestNG are shipped with IntelliJ IDEA. Unless you have the testing dependencies defined in your Maven build file, these libraries will not be included in the classpath ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required