Search code examples
javaunit-testingintellij-ideajunit

Configuring IntelliJ IDEA for unit testing with JUnit


I decided to try out IntelliJ this morning via the trial version and installed the JUnit plugin. I made a new Java project and I want to write a test case for it.

How do I add the junit.jar file to my project? (I actually want to add it to every java project, now and forever more - is there a way of doing that?).


Solution

  • Press Ctrl+Shift+T in the code editor. It will show you popup with suggestion to create a test.

    Mac OS: ⌘ Cmd+Shift+T