Plan plan = plan("insert into users (id, name) values (42, 'Deep Thought'), (99, 'Marvin')");
Iterator<PlanNode> iterator = plan.iterator();
PlanNode planNode = iterator.next();
assertThat(planNode, instanceOf(ESIndexNode.class));
ESIndexNode indexNode = (ESIndexNode) planNode;
Map<String, Object> values0 = XContentHelper.convertToMap(indexNode.sourceMaps().get(0), false).v2();
assertThat(indexNode.sourceMaps().size(), is(2));
assertThat(values0.size(), is(2));
Map<String, Object> values1 = XContentHelper.convertToMap(indexNode.sourceMaps().get(1), false).v2();
assertThat(values1.size(), is(2));
assertThat((Integer) values0.get("id"), is(42));
assertThat((String) values0.get("name"), is("Deep Thought"));
assertThat((Integer) values1.get("id"), is(99));
assertThat((String) values1.get("name"), is("Marvin"));
assertThat(indexNode.outputTypes().size(), is(1));
assertEquals(DataTypes.LONG, indexNode.outputTypes().get(0));
assertTrue(plan.expectsAffectedRows());
}