How to create TestContext for Spring Test?

后端 未结 2 898
孤独总比滥情好
孤独总比滥情好 2021-02-05 15:28

I have a relatively small Java library that implements a few dozen beans (no database or GUI). I have created a Spring Bean configuration file that other Java projects use to in

2条回答
  •  悲哀的现实
    2021-02-05 16:05

    To find it directly under src/test/resources, change it to:

    @ContextConfiguration({"classpath:/test-applicationContext.xml"})
    

    When you're not specifying anything, then Spring search in the same package as the test class.

提交回复
热议问题