I'm wondering what's the best possible way to make DbUnit work with MySQL's JSON(B) type columns? We do have such columns here and there and whenever I am trying to feed the test data from XML file via @DatabaseSetup
I get the NoSuchColumnException which prevents me form making of any sensible integration tests with entities or repos that deals with JSON:
org.dbunit.dataset.NoSuchColumnException: assistant_event.AEV_CONTEXT - (Non-uppercase input column: aev_context) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive.
I get that this is because my AEV_CONTEXT
column didn't get recognized because, well, it's a JSON column:
@Type(type = "json")
@Column(name = "aev_context", columnDefinition = "json")
private Context context;
However, I'm getting a hard time while trying to workaround it. And, what's even more odd, I couldn't find such workaround anywhere here either! In fact, I don't event know if that's more Hibernate or DbUnit thing.
Is it really only me had this problem so far? Any advice would be much appreciated!
Oh, and in case you wondering, that's how I get JSON support for Hibernate:
https://vladmihalcea.com/how-to-map-json-objects-using-generic-hibernate-types/