Skip to content

Commit

Permalink
HSEARCH-4021 Flush after a purge in tests to ensure the purge is visi…
Browse files Browse the repository at this point in the history
…ble from tests

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
  • Loading branch information
yrodiere committed Oct 29, 2020
1 parent 0f3bb1f commit 058c016
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -19,6 +19,7 @@
import org.hibernate.search.integrationtest.showcase.library.model.Document;
import org.hibernate.search.integrationtest.showcase.library.model.LibraryServiceOption;
import org.hibernate.search.mapper.orm.Search;
import org.hibernate.search.mapper.orm.work.SearchWorkspace;

import org.springframework.beans.factory.annotation.Autowired;

Expand Down Expand Up @@ -152,6 +153,8 @@ public List<String> getAuthorsOfBooksHavingTerms(String terms, SortOrder order)

@Override
public void purge() {
Search.session( entityManager ).workspace( Document.class ).purge();
SearchWorkspace workspace = Search.session( entityManager ).workspace( Document.class );
workspace.purge();
workspace.flush();
}
}

0 comments on commit 058c016

Please sign in to comment.