@Test
public void bulkOperationWithIndex() throws JSONException {

    Map source = new HashMap();
    source.put("field", "value");
    Bulk bulk = new Bulk.Builder()
            .addAction(new Index.Builder(source).index("twitter").type("tweet").id("1").build())
            .build();
    executeAsserts(bulk);
    String expectedData = "{\"index\":{\"_id\":\"1\",\"_index\":\"twitter\",\"_type\":\"tweet\"}}\n" +
            "{\"field\":\"value\"}";
    JSONAssert.assertEquals(expectedData, bulk.getData(new Gson()).toString(), false);
}