I want to try to make unit test with DBUnit but I have a problem with my dataset.
Here is my persistence object:
@Entity
@Table(name = "personnes")
public class Personne implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer pk;
@Column
private String name;
}
And my dataset:
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<personnes name="toto" pk="1" />
</dataset>
My problem is with the name column, I get this error:
org.dbunit.dataset.NoSuchColumnException: personnes.NAME - (Non-uppercase input column: name) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive.
I don't understand why dbunit search a column "NAME" whereas my column is "name".
Thanks for your help.
Since you don't specify the column name in the mapping, I guess the underlying ORM framework generates the column name "NAME" for it.
To resolve this error/warning, you could add the column name to the mapping
resulting in a lower-case column name or use upper-case notation in your dataset
leaving the upper-case column name.