springboot2.0junit
时间: 2023-10-12 07:01:37 浏览: 110
SpringBoot2.0整合JUnit的示例代码可以在引用中找到。在Spring Boot项目中,如果要编写测试类,必须在类上面加上@SpringBootTest注解。对于2.4.0版本的Spring Boot,使用Junit5,不需要再添加@RunWith注解。在示例代码中,使用了@Autowired注解注入了一个IPersonService的实例,然后在测试方法contextLoads()中调用了该实例的savePerson()方法进行测试。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [SpringBoot2.0完美整合Dubbo](https://blog.csdn.net/weixin_43160251/article/details/119541822)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Spring boot2.0集成Junit](https://blog.csdn.net/lanshizizhong/article/details/110005769)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文