单元测试
1.关于Maven依赖范围
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
当test为test时,在main文件夹中创建的单元测试方法报错,将范围改成compile,右侧会弹出一个弹窗,点击Enable Auto-Imported才会自动引入


2.idea中的Maven项目,在main、test文件夹中要创建二级文件夹再创建类,否则容易出错

版权声明:本文为thedevilisme888原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。