Newbie: Test Generation support (for Java)
Answered
I'm a newbie to IntelliJ.
I am currently using Community Edition, EAP 2018.1
I had thought IntelliJ supports JUnit, TestNG & Spock.
I'm slightly unsure about which plugins (if any) I also need active, but currently if I load a Java source file and position my cursor over the class declaration, CTRL-ENTER does not offer a 'generate test' option, which I'd expected to see - Similarly there's no entry that looks relevant under the 'Code' option
Am I missing a plugin?
Interacting in the wrong way?
Expecting something from CE that is only in ultimate?
Thanks
Please sign in to leave a comment.
Ah, found 'create tests' using option-enter (macOS)
Having written a test, how do I then run it? If I use the context menu on the test class (.groovy) I see no options to create a run configuration? If I manually go into run configurations, whilst JUnit and TestNG are listed, there's no option for spock?
Do you see green triangles near test methods?
Nope - nothing... I am wondering how much spock support there is in IntelliJ (I checked out the non-EAP build too)
For example
- Though there are assists to create a test in spock, there is no auto-fix for missing modules (I'm fixing in maven configuration)
- The 'run' configuration menu makes no mention of spock. It does offer explicit Unit/TestNG ... and also has groovy
Previous projects I've used (though I'm still new to IntelliJ) have used TestNG or JUnit... but I have some new modules for a small project/small team and thought it worth trying out spock for a change - I like the idea of a more test specific DSL
When browsing for IntelliJ information on the web there does seem to be reference to Spock.. in places the implication is it's easy, but I've yet to find screenshots/tutorial or anyone writing up their actual usage with spock.
So am I expecting too much?
Now wondering whether to not bother with spock (in part because it's also something new for the other few team members to take onboard and setup/configure) .