我有一个包含 JSON 列的表,当我使用数据集运行测试时。
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.
我的数据集:
<?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>
观察:我的表已经存在于数据库中。
最佳答案
默认情况下,DbUnit 不理解 json 字段设置。 您要么在测试中忽略它,要么为 DbUnit 编写自定义扩展
关于junit - 错误 NoSuchColumnException DbUnit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31920533/