@Test public void testQueryWithSpaceInColumnName() throws Exception { Mock mock = new Mock(MockType.THREE); List<SpacePerson> result = mock.getJdbcTemplate().query( "select last_name as \"Last Name\", age, birth_date, balance from people", new BeanPropertyRowMapper<SpacePerson>(SpacePerson.class)); assertEquals(1, result.size()); verifySpacePerson(result.get(0)); mock.verifyClosed(); }
protected void verifySpacePerson(SpacePerson bean) { assertEquals("Bubba", bean.getLastName()); assertEquals(22L, bean.getAge()); assertEquals(new java.util.Date(1221222L), bean.getBirthDate()); assertEquals(new BigDecimal("1234.56"), bean.getBalance()); }