@Test
public void testTableMapEvent() {

  eventHeader.setEventType(EventType.TABLE_MAP);
  TableMapEventData eventData = new TableMapEventData();
  eventData.setDatabase(DATABASE);
  eventData.setTable(TABLE);
  eventData.setTableId(TABLE_ID);
  eventData.setColumnTypes(new byte[] {(byte) 0, (byte) 1, (byte) 2});
  Optional<BinlogEvent> binlogEvent =
      BinaryLogConnectorEventMapper.INSTANCE.map(
          new Event(eventHeader, eventData), BINLOG_FILE_POS);
  assertTrue(binlogEvent.isPresent());
  assertTrue(binlogEvent.get() instanceof TableMapEvent);
  TableMapEvent tableMapEvent = (TableMapEvent) (binlogEvent.get());
  assertEquals(BINLOG_FILE_POS, tableMapEvent.getBinlogFilePos());
  assertEquals(DATABASE, tableMapEvent.getDatabase());
  assertEquals(TABLE, tableMapEvent.getTable());
  assertEquals(TABLE_ID, tableMapEvent.getTableId());
  assertEquals(
      ImmutableList.of(ColumnDataType.DECIMAL, ColumnDataType.TINY, ColumnDataType.SHORT),
      tableMapEvent.getColumnTypes());
}