BlessingCR’s Blog
BlessingCR’s Blog

如何无痛单元测试

Idea插件商店搜索如下两个软件,其中Squraretest需要付费。

image id

TestMe:

  1. 打开任何需要单元测试的文件,选择Code→Test Me→ JUnit 5, 即可自动化生成对应单元测试。
  2. 如果遇到List.of报错,建议检查jdk版本是否大于9

Squraretest:

  1. 打开任何需要单元测试的文件,菜单栏,Squraretest→Gennerate Test
  2. 自行判断setUp是否需要,中间涉及的Service层DAO层等是否需要mock,如果使用Spring注入的话,需要加上@SpringBootTest 和 @Resource (非DAO层单元测试建议使用@Mock)

发表回复

textsms
account_circle
email

  • Very interesting subject, appreciate it for posting.

    2 月前 回复
  • I too think thus, perfectly composed post! .

    2 月前 回复
  • Terrific post however I was wondering if you could write a litte more on this topic? I’d be very thankful if you could elaborate a little bit more. Thank you!

    2 月前 回复
  • I have been absent for a while, but now I remember why I used to love this site. Thanks, I’ll try and check back more often. How frequently you update your site?

    2 月前 回复
  • It is really a great and helpful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

    2 月前 回复
  • I will right away grasp your rss as I can not to find your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly permit me understand in order that I may subscribe. Thanks.

    2 月前 回复
  • Hey! I know this is kind of off topic but I was wondering which blog platform are you using for this site? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform. I would be fantastic if you could point me in the direction of a good platform.

    1 月前 回复
  • Williamprone

    Часто используется готовая база для хрумера, которая уже оптимизирована под определенные задачи.

    3 周前 回复

BlessingCR’s Blog

如何无痛单元测试
Idea插件商店搜索如下两个软件,其中Squraretest需要付费。 TestMe: 打开任何需要单元测试的文件,选择Code→Test Me→ JUnit 5, 即可自动化生成对应单元测试。 如果遇到List.of报错,建…
扫描二维码继续阅读
2024-02-26