Issue
I'm trying to apply TDD principles when working in the IntelliJ IDEA but I'm encountering a problem and I don't know if there is a feature or a plugin I don't know about to help me.
I've just discovered that you can easily Navigate to the test class corresponding to current class in the editor with CTRL
+ SHIFT
+ T
. If the Test Class does not exist, it will ask you to create it.
In a reverse situation, when I create a Test Class with no corresponding Test Subject and that I press the previous shortcut, it just tells me No test subjects found
.
Is there a way to quickly create the test subject class when it does not exists?
Solution
If you refer to the test subject by name (for example, try to create a class):
Hello hello = new Hello();
...then you can use the "Create Class from Usage" quickfix to create the class for you. Simply put the name on the "Hello" identifier (which will be unresolved) and press Alt-Enter.
Answered By - yole