spring - @ContextConfiguration fail to load config file in src/test/resources

后端 未结 7 1986
不知归路
不知归路 2021-02-05 04:13

I\'ve tried to load the spring config file in src/test/resources classpath with the following abstract class:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextCon         


        
7条回答
  •  生来不讨喜
    2021-02-05 05:06

    your application context must be included in classpath and put * :

    @ContextConfiguration(locations = { "classpath:*/application-context.xml" })
    

提交回复
热议问题