-
- @Ignore
- @Test
- public void test() throws Exception {
-// Persister storage = mock(Persister.class);
-// doReturn(null).when(storage).loadLastConfig();
-// doNothing().when(storage).persistConfig(any(ConfigSnapshotHolder.class));
-//
-// PersisterAggregator persister = new PersisterAggregator(storage);
-// persister.loadLastConfig();
-// persister.persistConfig(null);
-//
-// verify(storage).loadLastConfig();
-// verify(storage).persistConfig(any(ConfigSnapshotHolder.class));
- }
-
- public static class MockAdapter implements StorageAdapter, Persister {
-
- static int persist = 0;
-
- @Override
- public void persistConfig(ConfigSnapshotHolder holder) throws IOException {
- persist++;
- }
-
- static int load = 0;
-
- @Override
- public Optional<ConfigSnapshotHolder> loadLastConfig() throws IOException {
- load++;
- return Optional.absent();
- }
-
- static int props = 0;
-
- @Override
- public Persister instantiate(PropertiesProvider propertiesProvider) {
- props++;
- return this;
- }
-
- @Override
- public void close() {
- }
-
- }
-