@Test
public void testConvertToJestActionIndex() throws Exception {

  HTTPBulkLoader loader = getBulkLoader();
  ActionRequestKey key = ActionRequestKey.newBuilder()
      .setAction(Action.INDEX)
      .setId("myId")
      .build();
  BulkableAction<DocumentResult> action = loader.convertToJestAction(new HTTPBulkLoader.ActionRequest(key, "fakeindex", "faketype", 100L, "{}"));
  assertEquals("index", action.getBulkMethodName());
  assertEquals("myId", action.getId());
  assertEquals("fakeindex", action.getIndex());
  assertEquals("faketype", action.getType());
  assertEquals("{}", action.getData(new Gson()));
  assertEquals(0, action.getParameter(Parameters.VERSION).size());
  assertEquals(0, action.getParameter(Parameters.VERSION_TYPE).size());
  ActionRequestKey keyWithVersion = ActionRequestKey.newBuilder()
      .setAction(Action.INDEX)
      .setId("myId")
      .setVersion(123L)
      .setVersionType(VersionType.EXTERNAL)
      .build();
  BulkableAction<DocumentResult> actionWithVersion = loader.convertToJestAction(new HTTPBulkLoader.ActionRequest(keyWithVersion, "fakeindex", "faketype", 100L, "{}"));
  assertEquals("external", actionWithVersion.getParameter(Parameters.VERSION_TYPE).toArray()[0]);
  assertEquals(123L, actionWithVersion.getParameter(Parameters.VERSION).toArray()[0]);
}