@Test public void testReturnSinglePersister() { final PersisterSelector selector = new DevelopmentModePersisterSelector(new DefaultPersisterSelector(), false); final String persisterId = selector.getPersisterId(null, Arrays.asList("test")); Assert.assertEquals("test", persisterId); }
@Override public String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException("Didn't get any configuration persister!"); } if (developmentMode && scopePath != null && scopePath.findScopeByName(UserScopeDescriptor.NAME) != null) { return InMemoryPersister.ID; } return persisterSelector.getPersisterId(scopePath, configPersisterIds); }
DevelopmentModePersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException("Didn't get any configuration persister!"); } if (developmentMode && scopePath != null && scopePath.findScopeByName(UserScopeDescriptor.NAME) != null) { return InMemoryPersister.ID; } return persisterSelector.getPersisterId(scopePath, configPersisterIds); } }
DevelopmentModePersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException("Didn't get any configuration persister!"); } if (developmentMode && scopePath != null && scopePath.findScopeByName(UserScopeDescriptor.NAME) != null) { return InMemoryPersister.ID; } return persisterSelector.getPersisterId(scopePath, configPersisterIds); } DevelopmentModePersisterSelector(final PersisterSelector persisterSelector, final boolean developmentMode); }
DevelopmentModePersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException("Didn't get any configuration persister!"); } if (developmentMode && scopePath != null && scopePath.findScopeByName(UserScopeDescriptor.NAME) != null) { return InMemoryPersister.ID; } return persisterSelector.getPersisterId(scopePath, configPersisterIds); } DevelopmentModePersisterSelector(final PersisterSelector persisterSelector, final boolean developmentMode); @Override String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds); boolean isDevelopmentMode(); void setDevelopmentMode(final boolean developmentMode); }
DevelopmentModePersisterSelector implements PersisterSelector { @Override public String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds) { if (configPersisterIds.size() == 0) { throw new IllegalStateException("Didn't get any configuration persister!"); } if (developmentMode && scopePath != null && scopePath.findScopeByName(UserScopeDescriptor.NAME) != null) { return InMemoryPersister.ID; } return persisterSelector.getPersisterId(scopePath, configPersisterIds); } DevelopmentModePersisterSelector(final PersisterSelector persisterSelector, final boolean developmentMode); @Override String getPersisterId(final ScopePath scopePath, final Collection<String> configPersisterIds); boolean isDevelopmentMode(); void setDevelopmentMode(final boolean developmentMode);  }