Search code examples
junitdbunit

error NoSuchColumnException DbUnit


I have a table with a JSON column and when I run my tests with the dataset.

org.dbunit.dataset.NoSuchColumnException: hero.JSON - (Non-uppercase
input column: json) in ColumnNameToIndexes cache map. Note that the map's
column names are NOT case sensitive.

my dataset:

 <?xml version="1.0" encoding="UTF-8"?>
 <dataset>

   <hero id='000580548' json='{"id" : 1,"name" : "mySuperHero"}'/>
   <hero_profile id='000580548-mySuperHero' json='{"habilities": [], "stars" : 7}'/>
</dataset>

Obs: my tables already exists in the database.


Solution

  • By default DbUnit does not understand json field setup. Either you omit it in tests or write custom extension for DbUnit