In fact, DBUnit mentions this.
Here is the javadoc of the DatabaseConnection constructor
... schema is the database schema. Please note that the schema name is case sensitive. This is necessary because schemas with the same name, but a different case may coexist in the same database. ...
I think DBUnit developers are correcting the example schema name to avoid the problem that this behavior might cause.
DatabaseConnection is a universal superclass for all other databases specified by DatabaseConnection , H2DatabaseConnection , for example.
When a DatabaseConnection is created, DBUnit will retrieve metadata about the database, which is an implementation of java.sql.DatabaseMetaData way, from the jdbc connection.
After that, DBUnit will correct the schema name by checking the metadata, which is the reason you always get log messages.
DBUnit use the following DatabaseMetaData methods to validate
boolean storesUpperCaseIdentifiers() throws SQLException; boolean storesLowerCaseIdentifiers() throws SQLException;
and here is the jdbc H2 driver implementation
public boolean storesUpperCaseIdentifiers() { debugCodeCall("storesUpperCaseIdentifiers"); return true; }
therefore, the user table becomes USER
source share