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).


Related Resources

Navigate to Test
Go to your matching test class
Merge/Unmerge If Statements
Experiment with your code without changing the semantics
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