我将 Groovy 用于我的 Spring 应用程序,并尝试在我的测试中使用多个 XML bean 配置。我尝试使用@ContextHierarchy
但以下用法示例不起作用:
@RunWith(SpringRunner)
@SpringBootTest
@ContextHierarchy({@ContextConfiguration("a.xml"), ContextConfiguration("b.xml")})
public class MyTest {
...
}
我也试过:
@ContextConfiguration(locations={"a.xml", "b.xml"})
但效果不佳。
据我了解,Groovy 不喜欢“{”“}”,因为它的含义不同......?
如何在定义了两个配置 xml 的 groovy 中编写 Testclass?