Search code examples
intellij-ideajetbrains-idefile-templates

IntelliJ puts file header after package and imports


I run IntelliJ 2023.3.3. The IDE settings are set to incorporate the file header first:

enter image description here

However, when a test file is created via Ctrl + Shift + T the header is inserted after the package and imported in the new file.

How can this be fixed?


Solution

  • There are JUnit 3/4/5 Test Class templates under the Code tab on your screenshot, you need to adjust them as well.

    JUnit templates