I would like to customize the JUnit Test class template however I cannot find it anywhere in settings. This guy has the same problem. I can't find anything in File Templates or Live Templates. I'm using Intellij 11.
Right-click the test root folder or package in the test root folder in which you want to create a new test and select New | Java Class. Name the new class and press Enter . Press Alt+Insert and select Test Method to generate a new test method for this class. Name the new method and press Enter .
This is now solved in the latest IntelliJ IDEA / Android Studio. Go to:
Settings -Editor -File and Code Templates -Code (tab) -JUnit4 Test Class
edit the code in the right window.
The link provided by CrazyCoder suggests that this is not directly possible but that I you need to add if statements to the Class File Type template. I will probably split the template in two using a big if-else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With