@Test public void noWidgetSettings() throws ConfigException { try { StaticImageWidget.builder() .x(1) .y(1) .width(1) .height(1) .build() .basicValidate(null); fail("Exception should have been thrown"); } catch(final ConfigException e) { assertThat("Exception has the correct message", e.getMessage(), containsString("Widget Settings must be specified for Static Image Widget")); } }
@Override public void basicValidate(final String section) throws ConfigException { if (widgetSettings == null) { throw new ConfigException("Static Image Widget", "Widget Settings must be specified for Static Image Widget"); } super.basicValidate(section); }
StaticImageWidget extends Widget<StaticImageWidget, StaticImageWidgetSettings> { @Override public void basicValidate(final String section) throws ConfigException { if (widgetSettings == null) { throw new ConfigException("Static Image Widget", "Widget Settings must be specified for Static Image Widget"); } super.basicValidate(section); } }
StaticImageWidget extends Widget<StaticImageWidget, StaticImageWidgetSettings> { @Override public void basicValidate(final String section) throws ConfigException { if (widgetSettings == null) { throw new ConfigException("Static Image Widget", "Widget Settings must be specified for Static Image Widget"); } super.basicValidate(section); } @SuppressWarnings("ConstructorWithTooManyParameters") @Builder(toBuilder = true)  StaticImageWidget(final String name, final String type, final Integer x, final Integer y, final Integer width, final Integer height, final WidgetNameSetting displayWidgetName, final StaticImageWidgetSettings widgetSettings, final String cssClass); }
StaticImageWidget extends Widget<StaticImageWidget, StaticImageWidgetSettings> { @Override public void basicValidate(final String section) throws ConfigException { if (widgetSettings == null) { throw new ConfigException("Static Image Widget", "Widget Settings must be specified for Static Image Widget"); } super.basicValidate(section); } @SuppressWarnings("ConstructorWithTooManyParameters") @Builder(toBuilder = true)  StaticImageWidget(final String name, final String type, final Integer x, final Integer y, final Integer width, final Integer height, final WidgetNameSetting displayWidgetName, final StaticImageWidgetSettings widgetSettings, final String cssClass); @Override void basicValidate(final String section); }
StaticImageWidget extends Widget<StaticImageWidget, StaticImageWidgetSettings> { @Override public void basicValidate(final String section) throws ConfigException { if (widgetSettings == null) { throw new ConfigException("Static Image Widget", "Widget Settings must be specified for Static Image Widget"); } super.basicValidate(section); } @SuppressWarnings("ConstructorWithTooManyParameters") @Builder(toBuilder = true)  StaticImageWidget(final String name, final String type, final Integer x, final Integer y, final Integer width, final Integer height, final WidgetNameSetting displayWidgetName, final StaticImageWidgetSettings widgetSettings, final String cssClass); @Override void basicValidate(final String section);  }