public CompiledUserProfileAsserter<RA> assertUserDashboardWidgets(int expectedWidgetws) { if ( compiledUserProfile.getUserDashboard() == null) { if (expectedWidgetws != 0) { fail("Wrong number of widgets in user dashboard admin GUI configuration, expected " + expectedWidgetws + " but there was none"); } } else { assertEquals("Wrong number of user dashboard widgets in " + desc(), expectedWidgetws, getCompiledUserProfile().getUserDashboard().getWidget().size()); } return this; }
if (composite.getUserDashboard() == null) { composite.setUserDashboard(adminGuiConfiguration.getUserDashboard().clone()); } else {
private void mergeWidget(CompiledUserProfile composite, DashboardWidgetType newWidget) { String newWidgetIdentifier = newWidget.getIdentifier(); DashboardWidgetType compositeWidget = composite.findUserDashboardWidget(newWidgetIdentifier); if (compositeWidget == null) { composite.getUserDashboard().getWidget().add(newWidget.clone()); } else { mergeWidget(compositeWidget, newWidget); } }