import org.junit.Test; import static org.junit.Assert.*; public class MyJUnit3Test extends junit.framework.TestCase { @Test public void testAddition() { int sum = 2 + 2; assertEquals(4, sum); } } <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M5</version> </plugin> </plugins> </build>


上一篇:
下一篇:
切换中文