Search in sources :

Example 1 with Author

use of com.baeldung.spring.data.es.model.Author in project tutorials by eugenp.

the class ElasticSearchIntegrationTest method givenArticleService_whenSaveArticle_thenIdIsAssigned.

@Test
public void givenArticleService_whenSaveArticle_thenIdIsAssigned() {
    final List<Author> authors = asList(new Author("John Smith"), johnDoe);
    Article article = new Article("Making Search Elastic");
    article.setAuthors(authors);
    article = articleService.save(article);
    assertNotNull(article.getId());
}
Also used : Article(com.baeldung.spring.data.es.model.Article) Author(com.baeldung.spring.data.es.model.Author) Test(org.junit.Test)

Aggregations

Article (com.baeldung.spring.data.es.model.Article)1 Author (com.baeldung.spring.data.es.model.Author)1 Test (org.junit.Test)1