[英]How to import applicationContext.xml and Bean from external jar to @SpringBootTest?
我有一個測試:
@SpringBootTest
public class MyTest {
...
}
我有外部 jar,它有類 MyService(帶有 @Service)和 applicationContext.xml(為 MyService 創建 beans-args)。 如何將它們導入 MyTest? 我想檢查一下,我的 bean 是否已創建。
我的調查結果:
@ContextConfiguration(locations = {"classpath*:applicationContext.xml"})
@SpringBootTest
public class MyTest{
...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.