@Test public void shouldDeleteIndexForGivenEntity() { // given Class clazz = SampleEntity.class; // when elasticsearchTemplate.deleteIndex(clazz); // then assertThat(elasticsearchTemplate.indexExists(clazz), is(false)); }
@Before public void before() { elasticsearchTemplate.deleteIndex(SampleEntity.class); elasticsearchTemplate.createIndex(SampleEntity.class); elasticsearchTemplate.refresh(SampleEntity.class, true); }
@After public void clean() { elasticsearchTemplate.deleteIndex(ChildEntity.class); elasticsearchTemplate.deleteIndex(ParentEntity.class); }