@Test(expected = IllegalStateException.class) public void testExceptionIfNoPersister() { final DefaultPersisterSelector defaultPersisterSelector = new DefaultPersisterSelector(); defaultPersisterSelector.getPersisterId(null, Collections.<String> emptyList()); }
@Override public String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } if (configPersisterIds.size() > 1) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } return configPersisterIds.iterator().next(); }
DefaultPersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } if (configPersisterIds.size() > 1) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } return configPersisterIds.iterator().next(); } }
DefaultPersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } if (configPersisterIds.size() > 1) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } return configPersisterIds.iterator().next(); }  }
DefaultPersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } if (configPersisterIds.size() > 1) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } return configPersisterIds.iterator().next(); }  @Override String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds); }
DefaultPersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } if (configPersisterIds.size() > 1) { throw new IllegalStateException( "DefaultPersisterSelector needs exactly one configuration persister! got: " + configPersisterIds.size()); } return configPersisterIds.iterator().next(); }  @Override String getPersisterId(final ScopePath scope, final Collection<String> configPersisterIds);  }