コード例 #1
0
 @Test
 public void shouldDeleteIndexForGivenEntity() {
   // given
   Class clazz = SampleEntity.class;
   // when
   elasticsearchTemplate.deleteIndex(clazz);
   // then
   assertThat(elasticsearchTemplate.indexExists(clazz), is(false));
 }
コード例 #2
0
 @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);
 }