Search in sources :

Example 6 with PropertyParser

use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.

the class PropertyDescriptorFactoryTest method getDerivedWithSeparatorReturnsADerivedPropertyDescriptor.

@Test
public void getDerivedWithSeparatorReturnsADerivedPropertyDescriptor() {
    PropertyParser parser = mock(PropertyParser.class);
    PropertyDescriptor descriptor = instance.getDerivedWithSeparator("relationName", "propertyName", parser, "accepted", "--");
    assertThat(descriptor, is(instanceOf(RelatedPropertyDescriptor.class)));
}
Also used : PropertyDescriptor(nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor) PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) Test(org.junit.Test)

Example 7 with PropertyParser

use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.

the class PropertyParserFactoryTest method getParserReturnsAGenderPropertyParserForGender.

@Test
public void getParserReturnsAGenderPropertyParserForGender() {
    PropertyParser parser = instance.getParser(Gender.class);
    assertThat(parser, is(instanceOf(GenderPropertyParser.class)));
}
Also used : PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) Test(org.junit.Test)

Example 8 with PropertyParser

use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.

the class PropertyParserFactoryTest method getParserReturnsAPersonNamesDefaultPropertyParserForPersonNames.

@Test
public void getParserReturnsAPersonNamesDefaultPropertyParserForPersonNames() {
    PropertyParser parser = instance.getParser(PersonNames.class);
    assertThat(parser, is(instanceOf(PersonNamesDefaultNamePropertyParser.class)));
}
Also used : PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) Test(org.junit.Test)

Example 9 with PropertyParser

use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.

the class FacetDescriptionFactoryTest method createListFacetDescriptionCreatesAListFacetDescription.

@Test
public void createListFacetDescriptionCreatesAListFacetDescription() {
    PropertyParser parser = mock(PropertyParser.class);
    FacetDescription description = instance.createListFacetDescription("facetName", parser, "propertyName");
    assertThat(description, is(instanceOf(ListFacetDescription.class)));
}
Also used : PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) FacetDescription(nl.knaw.huygens.timbuctoo.search.description.FacetDescription) Test(org.junit.Test)

Example 10 with PropertyParser

use of nl.knaw.huygens.timbuctoo.search.description.PropertyParser in project timbuctoo by HuygensING.

the class FacetDescriptionFactoryTest method createListFacetDescriptionWithMultipleRelationsCreatesADerivedListFacetDescription.

@Test
public void createListFacetDescriptionWithMultipleRelationsCreatesADerivedListFacetDescription() {
    PropertyParser parser = mock(PropertyParser.class);
    FacetDescription description = instance.createListFacetDescription("facetName", parser, "propertyName", "relation", "relation2");
    assertThat(description, is(instanceOf(RelatedListFacetDescription.class)));
}
Also used : PropertyParser(nl.knaw.huygens.timbuctoo.search.description.PropertyParser) FacetDescription(nl.knaw.huygens.timbuctoo.search.description.FacetDescription) Test(org.junit.Test)

Aggregations

PropertyParser (nl.knaw.huygens.timbuctoo.search.description.PropertyParser)18 Test (org.junit.Test)18 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 FacetDescription (nl.knaw.huygens.timbuctoo.search.description.FacetDescription)3 PropertyDescriptor (nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor)3 Lists (com.google.common.collect.Lists)1 List (java.util.List)1 FacetValue (nl.knaw.huygens.timbuctoo.search.FacetValue)1 ListFacetValue (nl.knaw.huygens.timbuctoo.server.mediatypes.v2.search.ListFacetValue)1 SearchRequestV2_1 (nl.knaw.huygens.timbuctoo.server.mediatypes.v2.search.SearchRequestV2_1)1 TestGraphBuilder.newGraph (nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph)1 VertexMatcher (nl.knaw.huygens.timbuctoo.util.VertexMatcher)1 GraphTraversal (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal)1 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)1 Matchers.contains (org.hamcrest.Matchers.contains)1 Matchers.containsInAnyOrder (org.hamcrest.Matchers.containsInAnyOrder)1 Before (org.junit.Before)1 BDDMockito.given (org.mockito.BDDMockito.given)1 Mockito.mock (org.mockito.Mockito.mock)1