8
Intellij IDEA 执行 JUnit 单元测试的正确姿势
source link: https://iecho.cc/2018/12/23/Intellij-IDEA-%E6%89%A7%E8%A1%8C-JUnit-%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E6%AD%A3%E7%A1%AE%E5%A7%BF%E5%8A%BF/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Intellij IDEA 执行 JUnit 单元测试的正确姿势
Intellij IDEA 执行 JUnit 单元测试的正确姿势
2018-12-23 12:41:01
安装 JUnit 插件
File -> settings -> Plugins -> Browse repositories -> JUnit -> JUnit Generator V2.0
,安装后需重启 Intellij IDEA。为当前项目添加依赖
File -> Project Structure -> Libraries
,找到 Jetbrain Intellij IDEA 的安装目录下的lib
文件夹,添加hamcrest-core-1.3.jar
、junit-4.12.jar
以及junit.jar
。为待测试类添加测试样例
在待测类中按
ALT + INSERT
,选中JUnit Test
。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK