So S
So S

Reputation: 591

IntelliJ Alt+Enter dialog does not list "Create Test"

When I press Alt + Enter on a class name in IntelliJ (version 2017.2 on a Windows 10 machine) the Create Testoption is not listed. What can I do to get it there?

My window looks like enter image description here

And i was expecting something like enter image description here It comes from the IntelliJ help page for creating tests.

Is there an option to add the Create Test dialog to the menu?

Upvotes: 11

Views: 6378

Answers (3)

Enzo
Enzo

Reputation: 41

In order to create a test for JUnit in IntelliJ kindly follow these steps:

  1. Create a new Project using your favorite framework (e.g. Maven)
  2. Create a basic test class
  3. Next, right-click on your Class and choose “Generate” to generate a Test Class enter image description here

Ensure you check the class function/member checkbox then click OK

Upvotes: 0

Roman Bukin
Roman Bukin

Reputation: 67

To enable this option, go to IDEA Settings -> Editor -> Intentions -> Java -> Declaration and select checkbox Create Test. Search in top left corner can help.

IntellJ IDEA setting create test

Upvotes: 1

Panayiotis Poularakis
Panayiotis Poularakis

Reputation: 507

Default is Ctrl + Shift + T

or you can change it by entering the keymap menu, Ctrl + Alt + S to open up the settings, then keymap...

enter image description here

Upvotes: 5

Related Questions