@Test public void shouldUpdateAllSettings() throws Exception { List<ConfigurationSetting> settings = new ArrayList<ConfigurationSetting>(); settings.add(new ConfigurationSetting()); settings.add(new ConfigurationSetting()); service.update(settings); verify(repository, atLeastOnce()).setValue(Matchers.any(ConfigurationSetting.class)); }
public void update(List<ConfigurationSetting> settings) { for (ConfigurationSetting conf : settings) { configurationSettingRepository.setValue(conf); } }
ConfigurationSettingService { public void update(List<ConfigurationSetting> settings) { for (ConfigurationSetting conf : settings) { configurationSettingRepository.setValue(conf); } } }
ConfigurationSettingService { public void update(List<ConfigurationSetting> settings) { for (ConfigurationSetting conf : settings) { configurationSettingRepository.setValue(conf); } } @Autowired  ConfigurationSettingService(ConfigurationSettingRepository configurationSettingRepository); }
ConfigurationSettingService { public void update(List<ConfigurationSetting> settings) { for (ConfigurationSetting conf : settings) { configurationSettingRepository.setValue(conf); } } @Autowired  ConfigurationSettingService(ConfigurationSettingRepository configurationSettingRepository); ConfigurationSetting getByKey(String key); int getConfigurationIntValue(String key); String getConfigurationStringValue(String key); Boolean getBoolValue(String key); List<Object> getConfigurationListValue(String key, String delimiter); List<ConfigurationSetting> getConfigurations(); void update(List<ConfigurationSetting> settings); void saveBooleanValue(String key, Boolean value); List<ConfigurationSetting> getSearchResults(String s); }
ConfigurationSettingService { public void update(List<ConfigurationSetting> settings) { for (ConfigurationSetting conf : settings) { configurationSettingRepository.setValue(conf); } } @Autowired  ConfigurationSettingService(ConfigurationSettingRepository configurationSettingRepository); ConfigurationSetting getByKey(String key); int getConfigurationIntValue(String key); String getConfigurationStringValue(String key); Boolean getBoolValue(String key); List<Object> getConfigurationListValue(String key, String delimiter); List<ConfigurationSetting> getConfigurations(); void update(List<ConfigurationSetting> settings); void saveBooleanValue(String key, Boolean value); List<ConfigurationSetting> getSearchResults(String s);  }