FileSystemDataStorage implements DataStorage<R> { @Override public void updateCurrentData(DataUpdate<R> update, UpdateSummary changeSummary) { StoredDataMetadata metadata = new StoredDataMetadata( UUID.randomUUID().toString(), update.user, update.comment, update.baseVersionId, changeSummary, update.root.internal().createDataStorageMetadataDictionaryFromRoot(),getCurrentData().id); update(update.root, metadata); } FileSystemDataStorage(Path basePath, R initialData, MigrationManager<R> migrationManager, FileSystemFactoryStorageHistory<R> fileSystemFactoryStorageHistory, SimpleObjectMapper objectMapper);  FileSystemDataStorage(Path basePath, R initialData, MigrationManager<R> migrationManager, SimpleObjectMapper objectMapper);  FileSystemDataStorage(Path basePath, R initialData, MigrationManager<R> migrationManager, SimpleObjectMapper objectMapper, int maxConfigurationHistory); @Override R getHistoryData(String id); @Override Collection<StoredDataMetadata> getHistoryDataList(); @Override Collection<ScheduledUpdateMetadata> getFutureDataList(); @Override void deleteFutureData(String id); @Override R getFutureData(String id); @Override void addFutureData(ScheduledUpdate<R> futureFactory); @Override DataAndId<R> getCurrentData(); @Override void updateCurrentData(DataUpdate<R> update, UpdateSummary changeSummary); @Override void patchAll(DataStoragePatcher consumer); @Override void patchCurrentData(DataStoragePatcher consumer);  }
@Test public void test_getInitialFactory_housekeeping() { ExampleDataA initialExampleDataA = createInitialExampleDataA(); initialExampleDataA.stringAttribute.set("123"); int maxConfigurationHistory = 5; FileSystemDataStorage<ExampleDataA> fileSystemFactoryStorage = new FileSystemDataStorage<>(Paths.get(folder.toFile().toURI()), initialExampleDataA, createDataMigrationManager(),ObjectMapperBuilder.build(), maxConfigurationHistory); for (int i = 0; i < maxConfigurationHistory+1; i++) { fileSystemFactoryStorage.updateCurrentData(createUpdate(),null); } Assertions.assertEquals("123",fileSystemFactoryStorage.getInitialData().stringAttribute.get()); }
@Test public void test_getInitialFactory() { ExampleDataA initialExampleDataA = createInitialExampleDataA(); initialExampleDataA.stringAttribute.set("123"); FileSystemDataStorage<ExampleDataA> fileSystemFactoryStorage = new FileSystemDataStorage<>(Paths.get(folder.toFile().toURI()), initialExampleDataA, createDataMigrationManager(),ObjectMapperBuilder.build()); fileSystemFactoryStorage.updateCurrentData(createUpdate(),null); fileSystemFactoryStorage.updateCurrentData(createUpdate(),null); Assertions.assertEquals("123",fileSystemFactoryStorage.getInitialData().stringAttribute.get()); }