0

I have two integration tests. I'm trying to use a dynamic finder in both on a class called RoutingLane. The second test fails with the MissingMethodException.

Failure:  testMockRouteLane2(compliance.processor.services.CalculationServiceTests)
groovy.lang.MissingMethodException: No signature of method: RoutingLane.methodMissing() is applicable for argument types: () values: []

The mock functions are:

void testMockRouteLane() {
    def routingLaneMock = RoutingLane.findAllByMot('TL')
    assert routingLaneMock != null
    assert routingLaneMock.size() >= 1
}

void testMockRouteLane2() {
    def routingLaneMock = RoutingLane.findAllByMot('TL')
    assert routingLaneMock != null
    assert routingLaneMock.size() >= 1
}

What could be the cause?

4

1 回答 1

0

我想回答我自己的问题,因为我发现了这个问题,感谢阅读另一个线程。

Grails 与多个服务的集成测试

这是由于我将其从单元测试转换为集成测试,而不是删除@TestFor服务类名称的注释。

希望这可以帮助遇到此问题的其他人。

于 2013-08-07T19:35:15.810 回答