虽然网上有IDEA进行Junit单元测试的例子,但是都与视频中老师做的不一样。可有大佬分享一下IDEA做Junit单元测试方法的,谢谢
idea中先加入maven
在pom文件中添加:
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
然后maven会帮你自动给去下载junit的包