NamedView extends View { @Override public void expandGlobalDefinitions() { } NamedView(); void setName(final String viewName); String getName(); void setMergedNamedViewNames(final List<String> mergedNamedViewNames); List<String> getMergedNamedViewNames(); void setParameters(final Map<String, Object> parameters); Map<String, Object> getParameters(); @Override boolean canMerge(final View addingView, final View srcView); @Override void expandGlobalDefinitions();  }
@Test public void shouldNotExpandGlobalDefinitions() { final GlobalViewElementDefinition globalDef = mock(GlobalViewElementDefinition.class); final NamedView view = new NamedView.Builder() .name("name") .globalElements(globalDef) .build(); view.expandGlobalDefinitions(); assertEquals(1, view.getGlobalElements().size()); assertSame(globalDef, view.getGlobalElements().get(0)); }