Spring5中使用Junit
2019-03-22 本文已影响0人
tmac09
1.添加依赖包
(1.)Junit的依赖包(2.)在pom.xml中添加下图
![](https://img.haomeiwen.com/i16545682/866ecf3420f3be79.png)
![](https://img.haomeiwen.com/i16545682/fb5b696e8e08bbf7.png)
![](https://img.haomeiwen.com/i16545682/c5dfbf36481fb451.png)
2.编写待测程序
Max类
![](https://img.haomeiwen.com/i16545682/1d20acb04b1fa410.png)
配置
![](https://img.haomeiwen.com/i16545682/baa71e3836a654d7.png)
3.编写程序
Test快捷键(ctrl+shift+T或者alt+enter)
test的路径
![](https://img.haomeiwen.com/i16545682/27f6b747f25123f3.png)
![](https://img.haomeiwen.com/i16545682/b28d3338d720f4ae.png)
4.运行结果。
出现绿色即成功。
1.添加依赖包
(1.)Junit的依赖包(2.)在pom.xml中添加下图
2.编写待测程序
Max类
配置
3.编写程序
Test快捷键(ctrl+shift+T或者alt+enter)
test的路径
4.运行结果。
出现绿色即成功。