No File Specified
@ContextConfiguration
– with no parameters, (by Default) looks for the config file as the same name as the class with the suffix “-context.xml
“. For example,
Suppose our class is Greeting.java and our context file is spring-context.xml
package com.vaani.contextconfig; @ContextConfiguration public class Greeting{ ... }
Well this is equivalent to
@ContextConfiguration("/com/vaani/contextconfig/spring-context.xml") public class Greeting{
@
ContextConfiguration
没指定xml文件时,默认寻找文件名为 当前类名+“-context.xml"后缀的配置文件