MySQLJdbcDumper extends AbstractJDBCDumper { @Override public Object readValue(final ResultSet resultSet, final int index) throws SQLException { if (isDateTimeValue(resultSet.getMetaData().getColumnType(index))) { return resultSet.getString(index); } else { return resultSet.getObject(index); } } MySQLJdbcDumper(final InventoryDumperConfiguration inventoryDumperConfig, final DataSourceManager dataSourceManager); @Override Object readValue(final ResultSet resultSet, final int index);  }
@Test public void assertReadValue() throws SQLException { ResultSet resultSet = mock(ResultSet.class); ResultSetMetaData resultSetMetaData = mock(ResultSetMetaData.class); when(resultSet.getMetaData()).thenReturn(resultSetMetaData); when(resultSetMetaData.getColumnType(1)).thenReturn(Types.TIMESTAMP); when(resultSetMetaData.getColumnType(2)).thenReturn(Types.VARCHAR); mySQLJdbcDumper.readValue(resultSet, 1); mySQLJdbcDumper.readValue(resultSet, 2); verify(resultSet).getString(1); verify(resultSet).getObject(2); }