import org.junit.Test; import static org.junit.Assert.assertEquals; public class MyUnitTest { @Test public void testAddition() { int result = 2 + 2; assertEquals(4, result); } } <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</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>


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