工具
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,點(diǎn)擊File -> Settings -> plungins

2、輸入框中輸入junit,點(diǎn)擊紅色框的按鈕并進(jìn)行下一步操作

3、點(diǎn)擊Apply,之后重啟idea
4、打開需要建立測試類的文件,光標(biāo)移入該類,點(diǎn)擊Navigate -> Test

5、點(diǎn)擊 Create New Test

6、創(chuàng)建Test類,勾選中需要測試的方法

7、完成
