1
我试图设置在我的Spring MVC测试中将“默认视图包含”的杰克逊映射器属性设置为true。每these release notes,我有这个在我的application.properties
文件:Spring MVC测试:设置杰克逊默认查看包含
spring.jackson.mapper.default-view-inclusion=true
这时候我跑我的应用程序工作,而不是当我运行我的测试。为我的测试做同样的事情最好的方法是什么?
更新
一种方法我试过了,包括在测试我的配置文件。
@ContextConfiguration(classes = MyTest.Config.class, initializers = ConfigFileApplicationContextInitializer.class)
我可以在这加载我application.properties
的日志中看到,但它似乎没有任何效果。