DDMFormWebConfigurationModelListener implements ConfigurationModelListener { @Override public void onBeforeSave(String pid, Dictionary<String, Object> properties) throws ConfigurationModelListenerException { DDMFormWebConfiguration ddmFormWebConfiguration = ConfigurableUtil.createConfigurable( DDMFormWebConfiguration.class, new HashMapDictionary<>()); try { int autosaveInterval = GetterUtil.getInteger( properties.get("autosaveInterval"), ddmFormWebConfiguration.autosaveInterval()); _validateAutosaveInterval(autosaveInterval); } catch (Exception exception) { throw new ConfigurationModelListenerException( exception.getMessage(), DDMFormWebConfiguration.class, getClass(), properties); } }  @Override void onBeforeSave(String pid, Dictionary<String, Object> properties);  }
@Test(expected = ConfigurationModelListenerException.class) public void testNegativeAutosaveIntervalShouldThrowException() throws ConfigurationModelListenerException { Dictionary<String, Object> properties = new HashMapDictionary<>(); properties.put("autosaveInterval", "-1"); _ddmFormWebConfigurationModelListener.onBeforeSave(null, properties); }