1

我在 jhispter 上,我的 prod 文件对我来说工作正常。但是当我通过 @ActiveProfiles("prod") 更改类在 prod 配置文件上运行 junit 时

然后我在控制台上收到错误:-

[ERROR] org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@154abc4] to prepare test instance [com.enest.gom.web.rest.UserResourceTest@1d90afc]
java.lang.IllegalStateException: Failed to load ApplicationContext 

请帮我。

4

1 回答 1

0

测试应该使用“dev”配置文件运行:生产配置文件使用您的“真实”生产数据库,这就是为什么我希望您一定有一些数据库问题。

你能发布你的整个堆栈跟踪吗?

于 2014-02-04T09:43:58.717 回答