Familiar with Java but unfamiliar with IntelliJ, how does one "get started" with JUnit integration?
Inspired by Looking for a tutorial on using JUnit with Intellij IDEA 9.x which didn't answer my questions and was for an older version of IntelliJ.
Add a new testIn your production code in the editor, place the caret at the class for which you want to create a test, press Alt+Enter , and select Create Test. In the Create Test dialog, select the library that you want to use. If you don't have the necessary library yet, you will be prompted to download it.
Write your first unit test
Write a JUnit test -- here's mine:
import org.junit.Assert; import org.junit.Test; public class MyFirstTest { @Test public void firstTest() { Assert.assertTrue(true); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With