I'm trying to set a nullable BIGINT foreign key in my excel file to fill the data for my DbUnit test, but I'm getting the following exception when leaving the cell empty:

Caused by: org.dbunit.dataset.datatype.TypeCastException: Unable to typecast value <> of type <java.lang.String> to BIGINT

I've set the input in excel to number etc but it didn't help.

tried:

[NULL], [null], <null> 

Same exception expect the "value " changes ofc...

有帮助吗?

解决方案

Fixed it with adding:

ReplacementDataSet replacedDataSet = new ReplacementDataSet(dataSet); 
replacedDataSet.addReplacementObject("[NULL]", null);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top