@Before
 public void before() {
   clean();
   elasticsearchTemplate.createIndex(ParentEntity.class);
   elasticsearchTemplate.createIndex(ChildEntity.class);
   elasticsearchTemplate.putMapping(ParentEntity.class);
   elasticsearchTemplate.putMapping(ChildEntity.class);
 }
 @Test
 public void shouldCreateIndexGivenEntityClass() {
   // when
   boolean created = elasticsearchTemplate.createIndex(SampleEntity.class);
   // then
   assertThat(created, is(true));
 }
 @Test
 public void shouldPutMappingForGivenEntity() throws Exception {
   // given
   Class entity = SampleMappingEntity.class;
   elasticsearchTemplate.createIndex(entity);
   // when
   assertThat(elasticsearchTemplate.putMapping(entity), is(true));
 }
 @Before
 public void before() {
   elasticsearchTemplate.deleteIndex(SampleEntity.class);
   elasticsearchTemplate.createIndex(SampleEntity.class);
   elasticsearchTemplate.refresh(SampleEntity.class, true);
 }