idea 创建junit测试类
2018-12-26 本文已影响0人
不想明明
工具
IntelliJ IDEA
前提条件
1、pom.xml文件引入Junit依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
idea配置
1、打开idea,点击File -> Settings -> plungins

2、输入框中输入junit,点击红色框的按钮并进行下一步操作

3、点击Apply,之后重启idea
4、打开需要建立测试类的文件,光标移入该类,点击Navigate -> Test

5、点击 Create New Test

6、创建Test类,勾选中需要测试的方法

7、完成
