Skip to content
Advertisement

DBUnit PostgresqlDataTypeFactory does not recognizes enum list

I’m using DBUnit for an integration test, and before executing the test code I’m running into this error:

JavaScript

the column that is ignored is a list of enums. In the dataset it’s written like this :

JavaScript

I looked in the DBUnit FAQ and saw this issue , that says that I have to override the isEnumType() method to support my enum is Postgresql, so I did this:

JavaScript

But I still get the same error, and I don’t know why. Maybe I’m not overriding well the method? Maybe it’s not even the cause of my problem? If you need any other code just ask, thanks!

Advertisement

Answer

Well… I wasn’t able to solve this exactly but managed to solve it by a workaround.

This error comes because of the @DatabaseSetup annotation. If I did this process without using it, it still throws a ‘column not recognized’ error, because it doesn’t recognize postgres arrays (that was the root cause that I have) but I could solve it by creating a new DataTypeFactory that extends from the default one:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement