Search in sources :

Example 11 with SuggestionQuery

use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.

the class MorphiaViewDaoTest method testGetViewsBySuggestionTextDifferentUser.

@Test
public void testGetViewsBySuggestionTextDifferentUser() {
    createView(CODE, NAME);
    createView(CODE2, NAME2);
    createView(CODE3, NAME3);
    SuggestionQuery query = SuggestionQuery.createBuilder(USER2).text("test").build();
    List<View> views = viewDao.getViews(query);
    assertThat(views).extracting(View::getCode).isEmpty();
}
Also used : SuggestionQuery(io.lumeer.storage.api.query.SuggestionQuery) View(io.lumeer.api.model.View) MorphiaView(io.lumeer.storage.mongodb.model.MorphiaView) Test(org.junit.Test)

Aggregations

SuggestionQuery (io.lumeer.storage.api.query.SuggestionQuery)11 Test (org.junit.Test)8 Collection (io.lumeer.api.model.Collection)7 View (io.lumeer.api.model.View)5 MorphiaCollection (io.lumeer.storage.mongodb.model.MorphiaCollection)4 JsonView (io.lumeer.api.dto.JsonView)2 MorphiaView (io.lumeer.storage.mongodb.model.MorphiaView)2 JsonSuggestions (io.lumeer.api.dto.JsonSuggestions)1 Attribute (io.lumeer.api.model.Attribute)1 LinkType (io.lumeer.api.model.LinkType)1 SuggestionType (io.lumeer.api.model.SuggestionType)1 CollectionDao (io.lumeer.storage.api.dao.CollectionDao)1 LinkTypeDao (io.lumeer.storage.api.dao.LinkTypeDao)1 ViewDao (io.lumeer.storage.api.dao.ViewDao)1 SearchQuery (io.lumeer.storage.api.query.SearchQuery)1 Collections (java.util.Collections)1 List (java.util.List)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 RequestScoped (javax.enterprise.context.RequestScoped)1