Grails控制器单元测试MethodSelectionException

时间:2012-05-04 15:23:20

标签: unit-testing grails

我有一个单元测试类正在抛出这个奇怪的异常......我不知道这意味着什么......有人可以帮助我吗?

这是班级:

@TestFor(ApplicationController)
@TestMixin(MvcUnitTestCase)
class ApplicationControllerTests{

def init(){
    super.init(ApplicationController)
}

void testCheckOk() {
   def service = mockFor(ApplicationService)
   def myModel = new MyModel();
   service.demand.getModel {
       return myModel 
   }
   controller.service = service.createMock()
   def model = controller.index()

   assertEquals myModel, model.myModel
   assertEquals HttpServletResponse.SC_OK, response.status
}

这是例外:

org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method <init>() to invoke from this list:
public grails.test.MvcUnitTestCase#<init>(java.lang.String)
public grails.test.MvcUnitTestCase#<init>(java.lang.Class)

0 个答案:

没有答案