我想问一下grails中测试文件的最佳位置(即data.xml)。是测试/文件夹吗?
如何轻松地在Integration测试中加载测试文件?
谢谢, 刁
答案 0 :(得分:13)
in test / integration / resources
然后,即如果你使用spock进行测试,你可以做类似的事情:
def mediaBundlerService = Mock(MediaBundlerService)
mediaBundlerService.getPath(_) >> [path: new File('test/integration/resources/test-bundle/').absolutePath + "/"]