引入maven
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
带有test的时候,在src/main目录下的java程序是识别不了@Test注解的。maven推荐开发者,源代码和测试用例分开。
maven推荐源代码和测试用例分开的形式如下所示