`
iuottp
  • 浏览: 166819 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

Intellj idea 中创建测试 test

    博客分类:
  • JAVA
阅读更多

》》在idea中创建测试类有两种方法:

1)鼠标点中类名,使用"Alt+Enter", 会弹出intention action -> create tests



 

2)鼠标点中类名,使用“Ctrl+Shift+T”(默认), 会弹出 create new test



 

弹出的窗口,输入父类/包名,选择需要生成的method



 

这里说明下:如果是多模块工程,选择对应的包名(一般一个模块一个包名)会直接将代码生成到指定定包所在的模块下。

 

》》对于没有生成测试的方法:

在业务类中选中任意的方法,使用“Alt+Enter”,会弹出intention action-> generate missed test methods

在弹出的窗口中做相应的操作即可。



 

 

 

  • 大小: 17.5 KB
  • 大小: 10.6 KB
  • 大小: 18 KB
  • 大小: 28.2 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics