Search in sources :

Example 16 with SampleBean

use of org.jdbi.v3.core.SampleBean in project jdbi by jdbi.

the class FieldMapperTest method shouldBeCaseInSensitiveOfColumnAndFieldNames.

@Test
public void shouldBeCaseInSensitiveOfColumnAndFieldNames() throws Exception {
    mockColumns("LoNgfielD");
    Long aLongVal = 100L;
    when(resultSet.getLong(1)).thenReturn(aLongVal);
    when(resultSet.wasNull()).thenReturn(false);
    SampleBean sampleBean = mapper.map(resultSet, ctx);
    assertThat(sampleBean.getLongField()).isEqualTo(aLongVal);
}
Also used : SampleBean(org.jdbi.v3.core.SampleBean) Test(org.junit.Test)

Aggregations

SampleBean (org.jdbi.v3.core.SampleBean)16 Test (org.junit.Test)16 ValueTypeMapper (org.jdbi.v3.core.mapper.ValueTypeMapper)2 BigDecimal (java.math.BigDecimal)1