@Test
public void getFailedIndexResult() {

    String jsonString = "{\"error\":\"Invalid index\",\"status\":400}";
    Index index = new Index.Builder("{\"abc\":\"dce\"}").index("test").build();
    JestResult result = index.createNewElasticSearchResult(jsonString, 400, null, new Gson());
    assertFalse(result.isSucceeded());
    assertEquals("\"Invalid index\"", result.getErrorMessage());
}