【发布时间】:2012-05-14 18:52:06
【问题描述】:
我正在测试一些使用 java 库的 groovy 代码,我想模拟库调用,因为它们使用网络。所以被测代码看起来像:
def verifyInformation(String information) {
def request = new OusideLibraryRequest().compose(information)
new OutsideLibraryClient().verify(request)
}
我尝试使用 MockFor 和 StubFor,但出现以下错误:
No signature of method: com.myproject.OutsideLibraryTests.MockFor() is applicable for argument types: (java.lang.Class) values: [class com.otherCompany.OusideLibraryRequest]
我正在使用 Grails 2.0.3。
【问题讨论】:
标签: testing grails groovy constructor mocking