use of nl.knaw.huygens.timbuctoo.search.description.facet.CharterPortaalFondsFacetDescription.FONDS in project timbuctoo by HuygensING.
the class CharterPortaalFondsFacetDescriptionTest method filterChecksIfTheVertexContainsTheRightFondsAndFondsNaam.
@Test
public void filterChecksIfTheVertexContainsTheRightFondsAndFondsNaam() {
// fonds is unique, but two fondsen could have the same name.
Graph graph = newGraph().withVertex(v -> v.withTimId("id1").withProperty(FONDS, "fonds").withProperty(FONDS_NAAM, "fondsNaam")).withVertex(v -> v.withProperty(FONDS, "fonds1").withProperty(FONDS_NAAM, "fondsNaam")).build();
CharterPortaalFondsFacetDescription instance = new CharterPortaalFondsFacetDescription(FACET_NAME, Mockito.mock(PropertyParser.class));
GraphTraversal<Vertex, Vertex> traversal = graph.traversal().V();
instance.filter(traversal, Lists.newArrayList(new ListFacetValue("facetName", Lists.newArrayList("fondsNaam (fonds)"))));
List<Vertex> actual = traversal.toList();
assertThat(actual, contains(likeVertex().withTimId("id1")));
}
Aggregations