title: DBUnit with Postgresql and case sensitivity of column names - how does it work?
body: <p>I'm trying to write integration tests for our Spring Boot app. We want to use spring-test-dbunit and dbunit to setup and teardown test data on a Postgresql 9.4.2 database with an empty schema. </p>
  
  <p>After struggling with case insensitive table names, which I could easily solve by setting the DBUnit config property <em>caseSensitiveTableNames</em> to true, I am now having the exact same issue with column names, but I cannot figure out how to make DBUnit understand that Postgresql doesn't go well with upper case.</p>
  
  <p>Here's my (simplified) dataset:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;dataset&gt;
      &lt;customer_status status_id="0" descripton="description" /&gt;
  &lt;/dataset&gt;
  </code></pre>
  
  <p>And here's my basic test case so far:</p>
  
  <pre><code>@TestExecutionListeners({DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class, DbUnitTestExecutionListener.class })
  @RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = IntegrationTestConfig.class)
  @WebAppConfiguration
  @IntegrationTest("server.port:0")
  @DbUnitConfiguration(databaseConnection="dbUnitDatabaseConnection")
  @DatabaseSetup("classpath:datasets/authentication/oauth_setup.xml")
  @DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = { "classpath:datasets/authentication/oauth_setup.xml" })
  @DirtiesContext
  public class OauthIntegrationTest {
  
      @Value("${local.server.port}")
      int port;
  
      @Test
      public void thatStuffIsHappening() {
          //here be stuff (test fails on dbunit setup)    
      }
  }
  </code></pre>
  
  <p>And finally this is my DBUnit configuration so far:</p>
  
  <pre><code>@Import({ ControllerConfig.class, PersistenceConfig.class })
  public class IntegrationTestConfig extends App {
  
      @Autowired
      DataSource dataSource;
  
      @Bean
      public DatabaseConfigBean dbUnitDatabaseConfig() {
          final DatabaseConfigBean dbConfig = new DatabaseConfigBean();
          dbConfig.setDatatypeFactory(new PostgresqlDataTypeFactory());
          dbConfig.setCaseSensitiveTableNames(true);
          return dbConfig;
      }
  
      @Bean
      public DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection() {
          final DatabaseDataSourceConnectionFactoryBean connection = new DatabaseDataSourceConnectionFactoryBean();
          connection.setDataSource(this.dataSource);
          connection.setDatabaseConfig(this.dbUnitDatabaseConfig());
          connection.setSchema("public");
          return connection;
        }
    }
  </code></pre>
  
  <p>Running the test ends up with this error:</p>
  
  <blockquote>
    <p>org.dbunit.dataset.NoSuchColumnException: customer_status.DESCRIPTON -  (Non-uppercase input column: descripton) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive.</p>
  </blockquote>
  
  <p>Which is correct, because all column names in PSQL are in lower case. Why is DBUnit turning them to upper case and is there a way to prevent that?</p>
  
  <p>I've tried to google it, but the only thing matching my problem so far was <a href="https://stackoverflow.com/questions/5692834/dbunit-and-dataset-column">this</a>, but I really don't like reverting to old versions. </p>
  
  <p>Any hints? I can't believe that this is a serious problem and not just me overlooking something...</p>