@Test
  public void deleteNonExistentIndexWarmerTest() {
    client().admin().indices().prepareDelete().execute().actionGet();

    client().admin().indices().prepareCreate("test").execute().actionGet();

    try {
      client()
          .admin()
          .indices()
          .prepareDeleteWarmer()
          .setIndices("test")
          .setName("foo")
          .execute()
          .actionGet(1000);
      assert false : "warmer foo should not exist";
    } catch (IndexWarmerMissingException ex) {
      assertThat(ex.name(), equalTo("foo"));
    }
  }
 public void testIndexWarmerMissingException() throws IOException {
   IndexWarmerMissingException ex = serialize(new IndexWarmerMissingException("w1", "w2"));
   assertEquals("index_warmer [w1, w2] missing", ex.getMessage());
   assertArrayEquals(new String[] {"w1", "w2"}, ex.names());
 }