Generate a Test Class

Generate a new test class from your Java class.

We can generate test classes for our code using ⇧⌘T (macOS) / Ctrl+Shift+T (Windows/Linux). IntelliJ IDEA supports a variety of testing frameworks, including JUnit. We can use the IDE to generate a test method ⌘N (macOS) / Alt+Insert (Windows/Linux).

Interested in JVM Development?

call to action image

Did you know that you can take it one step further and generate test methods as well?

Learn More


Related Resources

Navigate to Test
Navigate to Test
Go to your matching test class with one keyboard shortcut.
Merge/Unmerge If Statements
Merge/Unmerge If Statements
Experiment with your code without changing the semantics.
Using the Terminal in IntelliJ IDEA
Using the Terminal in IntelliJ IDEA
IntelliJ IDEA has a built-in terminal that you can use to perform a number of functions inside your IDE.