Jakub Kubrynski
Jakub Kubrynski

Reputation: 14149

Change default test class name suffix in Intellij IDEA

By default when I generate test class in IDEA it has "Test" suffix. As I usually use Spock I want to change it to be "Spec" by default. Is it somehow possible?

Upvotes: 15

Views: 1418

Answers (2)

Namo
Namo

Reputation: 689

Below red box means 'Test' suffix. enter image description here

You can change it to'Spec'.

Upvotes: 0

Jakub Kubrynski
Jakub Kubrynski

Reputation: 14149

It's finally possible with the IntelliJ 2018.1:

With the IntelliJ IDEA 2018.1, you can customize a test class template and create a test class with Test as a prefix. Go to Preferences | Editor | Code Style | Java | Code Generation, and choose how the test class name should be generated. By default, the IDE creates a test class with the Test as a suffix.

Above is from this blog post

Upvotes: 9

Related Questions