假如使用Junit5,不再需要使用@ExtendWith注解,@SpringBootTest和其它@*Test默認(rèn)已經(jīng)包含了該注解。 @SpringBootTest替代了spring-test中的@ContextConfiguration注解,目的是加載ApplicationContext,啟動spring容器。 使用@SpringBootTest時并沒有像@ContextConfiguration一樣顯示指定locations或classes屬性,原因在于@SpringBootTest...
www.dbjr.com.cn/program/291771k...htm 2025-5-30