import junit.framework.Assert; import junit.framework.TestCase; public class MyTest extends TestCase { public void testAddition() { int result = 1 + 1; Assert.assertEquals(2, result); } } import org.junit.runner.RunWith; import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectPackages; @RunWith(JUnitPlatform.class) @SelectPackages("com.example.tests") public class TestSuite { } <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency>


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