Intellij: Change JUnit Test Class template

前端 未结 2 1652
我寻月下人不归
我寻月下人不归 2020-12-10 01:30

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 Templa

相关标签:
2条回答
  • 2020-12-10 02:02

    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.

    0 讨论(0)
  • 2020-12-10 02:12

    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.

    Image of the dialog from above description

    0 讨论(0)
提交回复
热议问题