Pregunta

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

¿Fue útil?

Solución

Fixed it with adding:

ReplacementDataSet replacedDataSet = new ReplacementDataSet(dataSet); 
replacedDataSet.addReplacementObject("[NULL]", null);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top