@Test void testGetAttributePathExpandedExpansionWithLabelAttribute() { EntityType grandparentEntityType = mock(EntityType.class); EntityType parentEntityType = mock(EntityType.class); EntityType childEntityType = mock(EntityType.class); Attribute grandparentAttribute = mock(Attribute.class); when(grandparentAttribute.hasRefEntity()).thenReturn(true); when(grandparentAttribute.getRefEntity()).thenReturn(parentEntityType); Attribute parentAttribute = mock(Attribute.class); when(parentAttribute.hasRefEntity()).thenReturn(true); when(parentAttribute.getRefEntity()).thenReturn(childEntityType); Attribute childAttribute = mock(Attribute.class); when(grandparentEntityType.getAttributeByName("grandparent")).thenReturn(grandparentAttribute); when(parentEntityType.getAttributeByName("parent")).thenReturn(parentAttribute); when(childEntityType.getLabelAttribute()).thenReturn(childAttribute); assertEquals( ImmutableList.of(grandparentAttribute, parentAttribute, childAttribute), QueryUtils.getAttributePathExpanded("grandparent.parent", grandparentEntityType, true)); }
public static List<Attribute> getAttributePathExpanded( String queryRuleField, EntityType entityType) { return getAttributePathExpanded(queryRuleField, entityType, false); }
QueryUtils { public static List<Attribute> getAttributePathExpanded( String queryRuleField, EntityType entityType) { return getAttributePathExpanded(queryRuleField, entityType, false); } }
QueryUtils { public static List<Attribute> getAttributePathExpanded( String queryRuleField, EntityType entityType) { return getAttributePathExpanded(queryRuleField, entityType, false); } private  QueryUtils(); }
QueryUtils { public static List<Attribute> getAttributePathExpanded( String queryRuleField, EntityType entityType) { return getAttributePathExpanded(queryRuleField, entityType, false); } private  QueryUtils(); static boolean containsOperator(Query<Entity> q, Operator operator); static boolean containsAnyOperator(Query<Entity> q, Set<Operator> operators); static boolean containsAnyOperator(List<QueryRule> rules, Set<Operator> operators); static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType); static boolean containsComputedAttribute(Sort sort, EntityType entityType); static boolean containsComputedAttribute(
      Iterable<QueryRule> rules, EntityType entityType); static boolean containsNestedQueryRuleField(Query<Entity> q); static Attribute getQueryRuleAttribute(QueryRule queryRule, EntityType entityType); static List<Attribute> getAttributePath(String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType, boolean expandLabelInsteadOfId); static boolean isTaggedType(Attribute attribute, IRI typeIRI); }
QueryUtils { public static List<Attribute> getAttributePathExpanded( String queryRuleField, EntityType entityType) { return getAttributePathExpanded(queryRuleField, entityType, false); } private  QueryUtils(); static boolean containsOperator(Query<Entity> q, Operator operator); static boolean containsAnyOperator(Query<Entity> q, Set<Operator> operators); static boolean containsAnyOperator(List<QueryRule> rules, Set<Operator> operators); static boolean containsComputedAttribute(Query<Entity> query, EntityType entityType); static boolean containsComputedAttribute(Sort sort, EntityType entityType); static boolean containsComputedAttribute(
      Iterable<QueryRule> rules, EntityType entityType); static boolean containsNestedQueryRuleField(Query<Entity> q); static Attribute getQueryRuleAttribute(QueryRule queryRule, EntityType entityType); static List<Attribute> getAttributePath(String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType); static List<Attribute> getAttributePathExpanded(
      String queryRuleField, EntityType entityType, boolean expandLabelInsteadOfId); static boolean isTaggedType(Attribute attribute, IRI typeIRI);  }