View extends ElementDefinitions<ViewElementDefinition, ViewElementDefinition> implements Cloneable { public void expandGlobalDefinitions() { if (null != globalEntities && !globalEntities.isEmpty()) { setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false)); globalEntities = null; } if (null != globalEdges && !globalEdges.isEmpty()) { setEdges(expandGlobalDefinitions(getEdges(), getEdgeGroups(), globalEdges, false)); globalEdges = null; } if (null != globalElements && !globalElements.isEmpty()) { setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalElements, true)); setEdges(expandGlobalDefinitions(getEdges(), getEdgeGroups(), globalElements, true)); globalElements = null; } } View(); static View fromJson(final InputStream inputStream); static View fromJson(final Path filePath); static View fromJson(final byte[] jsonBytes); byte[] toCompactJson(); @Override String toString(); @Override ViewElementDefinition getElement(final String group); Set<String> getElementGroupBy(final String group); boolean isAllEntities(); void setAllEntities(final boolean allEntities); boolean isAllEdges(); void setAllEdges(final boolean allEdges); List<GlobalViewElementDefinition> getGlobalElements(); List<GlobalViewElementDefinition> getGlobalEntities(); List<GlobalViewElementDefinition> getGlobalEdges(); boolean hasPreAggregationFilters(); boolean hasPostAggregationFilters(); boolean hasPostTransformFilters(); boolean hasEntityFilters(); boolean hasEdgeFilters(); @SuppressWarnings("CloneDoesntCallSuperClone") @SuppressFBWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "Only inherits from Object") @Override View clone(); void expandGlobalDefinitions(); @JsonInclude(Include.NON_EMPTY) Map<String, String> getConfig(); void addConfig(final String key, final String value); String getConfig(final String key); boolean canMerge(final View addingView, final View srcView); @Override boolean equals(final Object obj); @Override int hashCode(); @JsonInclude(Include.NON_NULL) @JsonGetter("class") String getClassName();  }
@Test public void shouldCreateViewWithGlobalDefinitions() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .preAggregationFilter(new ElementFilter.Builder() .select(TestPropertyNames.PROP_1) .execute(new ExampleFilterFunction()) .build()) .groupBy(TestPropertyNames.PROP_1) .transientProperty(TestPropertyNames.PROP_2, String.class) .build()) .globalEntities(new GlobalViewElementDefinition.Builder() .postAggregationFilter(new ElementFilter.Builder() .select(IdentifierType.VERTEX.name()) .execute(new ExampleFilterFunction()) .build()) .groups(TestGroups.ENTITY, TestGroups.ENTITY_2) .build()) .globalEdges(new GlobalViewElementDefinition.Builder() .postTransformFilter(new ElementFilter.Builder() .select(IdentifierType.SOURCE.name()) .execute(new ExampleFilterFunction()) .build()) .groupBy() .groups(TestGroups.EDGE, TestGroups.EDGE_2) .build()) .entity(TestGroups.ENTITY_3, new ViewElementDefinition.Builder() .preAggregationFilter(new ElementFilter.Builder() .select(TestPropertyNames.DATE) .execute(new ExampleFilterFunction()) .build()) .groupBy(TestPropertyNames.DATE) .build()) .entity(TestGroups.ENTITY) .entity(TestGroups.ENTITY_2) .edge(TestGroups.EDGE) .edge(TestGroups.EDGE_2) .edge(TestGroups.EDGE_3) .build(); view.expandGlobalDefinitions(); JsonAssert.assertEquals(String.format("{%n" + " \"edges\" : {%n" + " \"BasicEdge2\" : {%n" + " \"groupBy\" : [ ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " } ],%n" + " \"postTransformFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"SOURCE\" ]%n" + " } ]%n" + " },%n" + " \"BasicEdge\" : {%n" + " \"groupBy\" : [ ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " } ],%n" + " \"postTransformFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"SOURCE\" ]%n" + " } ]%n" + " },%n" + " \"BasicEdge3\" : {%n" + " \"groupBy\" : [ \"property1\" ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " } ]%n" + " }%n" + " },%n" + " \"entities\" : {%n" + " \"BasicEntity2\" : {%n" + " \"groupBy\" : [ \"property1\" ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " } ],%n" + " \"postAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"VERTEX\" ]%n" + " } ]%n" + " },%n" + " \"BasicEntity\" : {%n" + " \"groupBy\" : [ \"property1\" ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " } ],%n" + " \"postAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"VERTEX\" ]%n" + " } ]%n" + " },%n" + " \"BasicEntity3\" : {%n" + " \"groupBy\" : [ \"dateProperty\" ],%n" + " \"transientProperties\" : {%n" + " \"property2\" : \"java.lang.String\"%n" + " },%n" + " \"preAggregationFilterFunctions\" : [ {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"property1\" ]%n" + " }, {%n" + " \"predicate\" : {%n" + " \"class\" : \"uk.gov.gchq.gaffer.function.ExampleFilterFunction\"%n" + " },%n" + " \"selection\" : [ \"dateProperty\" ]%n" + " } ]%n" + " }%n" + " } %n" + "}"), new String(view.toJson(true))); }
@Test public void shouldAddGlobalPropertiesToEntityGroup() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldSetEmptyEntitiesPropertiesGivenEmptyGlobalProperties() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties() .build()) .entity(TestGroups.ENTITY) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldOverrideEmptyGlobalPropertiesAndIncludeEntityGroupProperties() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties() .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder(). properties(TestPropertyNames.PROP_1) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldOverrideGlobalPropertiesWhenSpecificEntityGroupPropertiesSet() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldAddGlobalExcludePropertiesToEntityGroup() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder().build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldOverrideGlobalExcludePropertiesWhenSpecificEntityGroupExcludePropertiesSet() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldAddGlobalTransformToEntityGroup() { final ElementTransformer elementTransformer = new ElementTransformer.Builder() .select(TestPropertyNames.PROP_3) .execute(new Identity()) .project(TestPropertyNames.PROP_1) .build(); final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .transformer(elementTransformer) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(elementTransformer.getComponents().get(0).getFunction().getClass().getSimpleName(), view.getEntity(TestGroups.ENTITY).getTransformer().getComponents().get(0).getFunction().getClass().getSimpleName()); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldThrowExceptionWhenGlobalExcludePropertiesAndEntityPropertiesSet() { final View view = new View.Builder() .globalEntities(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_2, TestPropertyNames.PROP_3) .build()) .build(); try { view.expandGlobalDefinitions(); } catch (IllegalArgumentException e) { assertEquals("You cannot set both properties and excludeProperties", e.getMessage()); } }
@Test public void shouldAddGlobalPropertiesToEdgeGroup() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .edge(TestGroups.EDGE) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getProperties())); }
@Test public void shouldSetEmptyEdgePropertiesGivenEmptyGlobalProperties() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .properties() .build()) .edge(TestGroups.EDGE) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getProperties())); }
@Test public void shouldOverrideEmptyGlobalPropertiesAndIncludeEdgeGroupProperties() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .properties() .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder(). properties(TestPropertyNames.PROP_1) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getProperties())); }
@Test public void shouldOverrideGlobalPropertiesWhenSpecificEdgeGroupPropertiesSet() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getProperties())); }
@Test public void shouldAddGlobalExcludePropertiesToEdgeGroup() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder().build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getExcludeProperties())); }
@Test public void shouldOverrideGlobalExcludePropertiesWhenSpecificEdgeGroupExcludePropertiesSet() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getExcludeProperties())); }
@Test public void shouldAddGlobalTransformToEdgeGroup() { final ElementTransformer elementTransformer = new ElementTransformer.Builder() .select(TestPropertyNames.PROP_3) .execute(new Identity()) .project(TestPropertyNames.PROP_1) .build(); final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .transformer(elementTransformer) .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(elementTransformer.getComponents().get(0).getFunction().getClass().getSimpleName(), view.getEdge(TestGroups.EDGE).getTransformer().getComponents().get(0).getFunction().getClass().getSimpleName()); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEdge(TestGroups.EDGE).getExcludeProperties())); }
@Test public void shouldThrowExceptionWhenGlobalExcludePropertiesAndEdgePropertiesSet() { final View view = new View.Builder() .globalEdges(new GlobalViewElementDefinition.Builder() .groups(TestGroups.EDGE) .excludeProperties(TestPropertyNames.PROP_2) .build()) .edge(TestGroups.EDGE, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_2, TestPropertyNames.PROP_3) .build()) .build(); try { view.expandGlobalDefinitions(); } catch (IllegalArgumentException e) { assertEquals("You cannot set both properties and excludeProperties", e.getMessage()); } }
@Test public void shouldAddGlobalElementPropertiesToGroup() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldSetEmptyPropertiesGivenEmptyGlobalElementProperties() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties() .build()) .entity(TestGroups.ENTITY) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldOverrideEmptyGlobalElementPropertiesAndIncludeEntityGroupProperties() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties() .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder(). properties(TestPropertyNames.PROP_1) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldOverrideGlobalElementPropertiesWhenSpecificEntityGroupPropertiesSet() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .properties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getProperties())); }
@Test public void shouldAddGlobalExcludeElementPropertiesToEntityGroup() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder().build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldOverrideGlobalExcludeElementPropertiesWhenSpecificEntityGroupExcludePropertiesSet() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_1, TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldAddGlobalElementTransformToEntityGroupFromBuilder() { final ElementTransformer elementTransformer = new ElementTransformer.Builder() .select(TestPropertyNames.PROP_3) .execute(new Identity()) .project(TestPropertyNames.PROP_1) .build(); final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .transformer(elementTransformer) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .expandGlobalDefinitions() .build(); assertEquals(elementTransformer.getComponents().get(0).getFunction().getClass().getSimpleName(), view.getEntity(TestGroups.ENTITY).getTransformer().getComponents().get(0).getFunction().getClass().getSimpleName()); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldAddGlobalElementTransformToEntityGroup() { final ElementTransformer elementTransformer = new ElementTransformer.Builder() .select(TestPropertyNames.PROP_3) .execute(new Identity()) .project(TestPropertyNames.PROP_1) .build(); final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .transformer(elementTransformer) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .excludeProperties(TestPropertyNames.PROP_3) .build()) .build(); view.expandGlobalDefinitions(); assertEquals(elementTransformer.getComponents().get(0).getFunction().getClass().getSimpleName(), view.getEntity(TestGroups.ENTITY).getTransformer().getComponents().get(0).getFunction().getClass().getSimpleName()); assertEquals(Sets.newHashSet(TestPropertyNames.PROP_3), Sets.newHashSet(view.getEntity(TestGroups.ENTITY).getExcludeProperties())); }
@Test public void shouldThrowExceptionWhenGlobalExcludeElementPropertiesAndEntityPropertiesSet() { final View view = new View.Builder() .globalElements(new GlobalViewElementDefinition.Builder() .groups(TestGroups.ENTITY) .excludeProperties(TestPropertyNames.PROP_2) .build()) .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder() .properties(TestPropertyNames.PROP_2, TestPropertyNames.PROP_3) .build()) .build(); try { view.expandGlobalDefinitions(); } catch (IllegalArgumentException e) { assertEquals("You cannot set both properties and excludeProperties", e.getMessage()); } }