@Test
public void testInsertMutation() throws Exception {

  Serializable[] change = new Serializable[4];
  change[0] = 12131L;
  change[1] = "test_user";
  change[2] = 25;
  change[3] = 0;
  Serializable[] change2 = new Serializable[4];
  change2[0] = 12334L;
  change2[1] = "test_user2";
  change2[2] = 12;
  change2[3] = 1;
  BinlogEvent event =
      new WriteEvent(
          TABLE_ID, SERVER_ID, TIMESTAMP, BINLOG_FILE_POS, ImmutableList.of(change, change2));
  List<? extends Mutation> mutations = eventMapper.map(event);
  assertEquals(2, mutations.size());
  assertTrue(mutations.get(0) instanceof MysqlInsertMutation);
  MysqlInsertMutation mutation = (MysqlInsertMutation) mutations.get(0);
  validateMetadata(mutation, 0);
  Row row = mutation.getEntity();
  assertEquals(12131L, row.getColumns().get("id").getValue());
  assertEquals("test_user", row.getColumns().get("name").getValue());
  assertEquals(25, row.getColumns().get("age").getValue());
  assertEquals(0, row.getColumns().get("sex").getValue());
  assertTrue(mutations.get(1) instanceof MysqlInsertMutation);
  mutation = (MysqlInsertMutation) mutations.get(1);
  validateMetadata(mutation, 1);
  row = mutation.getEntity();
  assertEquals(12334L, row.getColumns().get("id").getValue());
  assertEquals("test_user2", row.getColumns().get("name").getValue());
  assertEquals(12, row.getColumns().get("age").getValue());
  assertEquals(1, row.getColumns().get("sex").getValue());
}