Unit testing DbUnit excel可空外键
我试图在excel文件中设置一个可为null的Unit testing DbUnit excel可空外键,unit-testing,dbunit,Unit Testing,Dbunit,我试图在excel文件中设置一个可为null的BIGINT外键,以填充我的DbUnit测试的数据,但将单元格保留为空时,出现以下异常: Caused by: org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <> of type <java.lang.String> to BIGINT 原因:org.dbunit.dataset.datatype.TypeCastExcepti
BIGINT
外键,以填充我的DbUnit
测试的数据,但将单元格保留为空时,出现以下异常:
Caused by: org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <> of type <java.lang.String> to BIGINT
原因:org.dbunit.dataset.datatype.TypeCastException:无法将类型的值类型转换为BIGINT
我已将excel中的输入设置为数字等,但没有帮助
尝试:
[NULL], [null], <null>
[NULL],[NULL],
相同的例外情况,除了C的“值”更改…通过添加以下内容来修复它:
ReplacementDataSet replacedDataSet = new ReplacementDataSet(dataSet);
replacedDataSet.addReplacementObject("[NULL]", null);
我把
“[NULL]”
替换为“[NULL]”