junit测试用例加载spring配置文件

junit加载pom引用项目的xml配置文件,如果定义了<beans profile="dev">,必须在测试用例类上面加上标记

@ActiveProfiles("product"),否则spring找不到<beans profile="dev">里面的配置。提示错误信息:

No bean named '*Mongo' is defined

posted @ 2014-10-08 17:41  唾手可得的树  阅读(859)  评论(0编辑  收藏  举报