Fix import of exports without queryable store data

This commit is contained in:
Rene Pfeuffer
2026-02-11 13:04:08 +00:00
committed by Thomas Zerr
parent fbd78ab7e1
commit 4a767d3886
3 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Import of repository exports without queryable store data

View File

@@ -101,7 +101,8 @@ public class RepositoryQueryableStoreExporter {
try {
File dataDir = new File(workdir, "queryable-store-data");
if (!dataDir.exists() || !dataDir.isDirectory()) {
throw new RuntimeException("Directory 'queryable-store-data' not found in workdir: " + workdir.getAbsolutePath());
log.trace("missing directory {} - skipping import of queryable data", dataDir.getAbsolutePath());
return;
}
JAXBContext jaxbContext = JAXBContext.newInstance(StoreExport.class);

View File

@@ -175,5 +175,14 @@ class RepositoryQueryableStoreExporterTest {
}
}
}
@Test
void shouldSkipImportIfDirectoryIsMissing(SimpleTypeStoreFactory simpleTypeStoreFactory, @TempDir File tempDir) throws IOException {
exporter.importStores("42", tempDir);
try (QueryableMutableStore<SimpleType> store = simpleTypeStoreFactory.getMutable("42")) {
assertThat(store.getAll()).hasSize(0);
}
}
}