Ejemplo n.º 1
0
  @Test
  public void shouldIndexSingleBookEntity() {

    Book book = new Book();
    book.setId("123455");
    book.setName("Spring Data Elasticsearch");
    book.setVersion(System.currentTimeMillis());

    UserBikeFitSession userBikeFitSession = new UserBikeFitSession();

    userBikeFitSession.setVersion(System.currentTimeMillis());
    userBikeFitSession.setId(UUID.randomUUID().toString());

    repository.save(userBikeFitSession);
    // lets try to search same record in elasticsearch
    UserBikeFitSession indexedBook = repository.findOne(book.getId());
    assertThat(indexedBook, is(notNullValue()));
    assertThat(indexedBook.getId(), is(book.getId()));
  }
Ejemplo n.º 2
0
 @Before
 public void emptyData() {
   repository.deleteAll();
 }