- maven
- IntelliJ IDEA (optional?)
-
Run
mvn archetype:generate -DgroupId=it.xpeppers -DartifactId=INSERT-PROJECT-NAME -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
-
Import the created project as a maven projecy
-
Inside pom.xml set JUnit version to 4.12 (or latest stable) && enable auto import (promped by intellij)
-
Delete the two classes created automatically
-
Create a new class using this "template"
package it.xpeppers;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class CalcTest {
@Test
public void name() {
assertEquals(1,1);
}
}
- Run the code. The test should pass