}
@Test
public void testCreateIndexWithAliasesFilterNotValid() {
//non valid filter, invalid json
CreateIndexRequestBuilder createIndexRequestBuilder = prepareCreate("test").addAlias(new Alias("alias2").filter("f"));
try {
createIndexRequestBuilder.get();
fail("create index should have failed due to invalid alias filter");
} catch (ElasticsearchIllegalArgumentException e) {
assertThat(e.getMessage(), equalTo("failed to parse filter for alias [alias2]"));
}
//valid json but non valid filter
createIndexRequestBuilder = prepareCreate("test").addAlias(new Alias("alias2").filter("{ \"test\": {} }"));
try {
createIndexRequestBuilder.get();
fail("create index should have failed due to invalid alias filter");
} catch (ElasticsearchIllegalArgumentException e) {