Question

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...

Was it helpful?

Solution

Fixed it with adding:

ReplacementDataSet replacedDataSet = new ReplacementDataSet(dataSet); 
replacedDataSet.addReplacementObject("[NULL]", null);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top