Reputation: 3550
We have a name convention for our test classes:
For unit test : TestMyCoolClazz
For integration tests : ITestMyCoolClazz
But whenever Intellij Idea prompts 'Create Test' dialog window, class name is always MyCoolClazzTest. So basically it adds a word 'Test' at the and of a class name.
So can a change it?
Upvotes: 2
Views: 660
Reputation: 740
There is a workaround using JUnitGenerator plugin, maybe it will suit your needs. Thing is, it doesn't allow to customize the mentioned 'Create Test' popup invoked by Shift+Ctrl+T, but you can customize the way how IDE generates tests by pressing Alt+Insert and then selecting JUnitTest -> JUnit 3/4.
So if it would be sufficient, there's the way: after installing this plugin, you can find JUnit Generator entry in Settings under the 'Other Settings' section. In a file template window, there is an editable test template, as shown below:
There is a line:
#set( $testClass="${entry.className}Test")
You can change it to, for example:
#set( $testClass="Test${entry.className}")
or #set( $testClass="ITest${entry.className}")
and that's it. I also noticed that IntelliJ restart is required.
Upvotes: 1