注意事项:
1.不能在SpringbootApplication中测试main函数;
2.可以在Controler中新建main函数,右键debug测试;
3.使用Statement连接成功
参考:https://blog.youkuaiyun.com/qq516071744/article/details/86499027
Spring Boot 测试技巧
本文分享了在Spring Boot项目中进行测试的一些注意事项和技巧,包括避免在SpringBootApplication中直接测试main函数,推荐在Controller中创建main函数进行debug测试,以及使用Statement进行数据库连接测试的成功案例。
注意事项:
1.不能在SpringbootApplication中测试main函数;
2.可以在Controler中新建main函数,右键debug测试;
3.使用Statement连接成功
参考:https://blog.youkuaiyun.com/qq516071744/article/details/86499027
1016

被折叠的 条评论
为什么被折叠?