我有一个grails的服务类,我正在测试,它给了我一个我不明白的奇怪信息..
在我的测试中我有......
expect:
validationRequest.every{
def result = service.validateStillageContent(it)
println "\nresult ->${result}"
result} instanceof ValidationResponse
where:
validationRequest | returnValue | validationType
new ValidationRequest(validationType:"serialPart") | "OK" | "serialPart"
给了我这个..
Condition not satisfied: validationRequest.every{ def result = service.validateStillageContent(it) println "\nresult ->${result}" result}
instanceof ValidationResponse | | | | true false ValidationRequest {validationType =' serialPart',documentReference =' null',partNumber =' null',altPartNumber =' null',vendorPartNumber = ' null',serialNumber =' null',stillage =' null',ducketReference =' null',sequence = null}
和
junit.framework.AssertionFailedError: Condition not satisfied:
validationRequest.every{ def result = service.validateStillageContent(it) println "\nresult ->${result}" result}
instanceof ValidationResponse | |
|真假 ValidationRequest {validationType =' serialPart',documentReference =' null',partNumber =' null',altPartNumber =' null',vendorPartNumber =&# 39; null',serialNumber =' null',stillage =' null',ducketReference =' null',sequence = null}
at com.dev.SequencingServiceSpec.Test the stillage validation with various types .. (SequencingServiceSpec.groovy:254)
和
result ->ValidationResponse{status='OK', errorMessage='null'}
我的表中有更多的条目,但它们都表现出相同的问题。正如我所看到的那样,服务调用会产生ValidationResponse的一个实例,但是测试给了我一个不满意的条件" ..有人可以解释原因吗?
谢谢