我正在为Webflow编写测试,我有一个webflow(A)在执行期间调用另一个webflow(子webflow)(B)。如果A呼叫B,它总是通过呼叫声明所需的参数/输入。单独测试A不是问题,但我如何自己测试B?输入参数的状态为:
input {
station(required: true)
}
我尝试从startFlow()开始,但这给了我以下异常:
Failure: testCreateWizardSubSubFlow(com.lstelcom.spectraweb.data.EquipmentFlowTests)
org.springframework.webflow.engine.FlowInputMappingException:
Errors occurred during input mapping on startup of the 'createWizardSubSub' flow;
errors = [[RequiredError@51a9e7fc mapping = station -> station, code = 'required', error = true, errorCause = [null], originalValue = [null], mappedValue = [null]]]
at grails.test.WebFlowTestCase.startFlow(WebFlowTestCase.groovy:130)
at com.lstelcom.spectraweb.data.EquipmentFlowTests.testCreateWizardSubSubFlow(EquipmentFlowTests.groovy:38)
由于我收到错误,WebFlowTestCase
中不存在带有输入参数的startFlow方法调用(例如,startFlow(new Station())):
groovy.lang.MissingMethodException: No signature of method: com.lstelcom.spectraweb.data.EquipmentFlowTests.startFlow() is applicable for argument types: (com.lstelcom.spectraweb.data.stations.Station) values: []
Possible solutions: getFlow(), getFlow()
at com.lstelcom.spectraweb.data.EquipmentFlowTests.testCreateWizardSubSubFlow(EquipmentFlowTests.groovy:38)
所以问题是如何使用输入参数测试webflow?