feat(importing): rebuild importer as modular canonical loaders (Phase 3, #669) #674

Merged
marcel merged 19 commits from feature/669-modular-importer into docs/import-migration 2026-05-27 11:34:29 +02:00
Showing only changes of commit 151d6aa03f - Show all commits

View File

@@ -3,6 +3,7 @@ package org.raddatz.familienarchiv.importing;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.raddatz.familienarchiv.PostgresContainerConfig; import org.raddatz.familienarchiv.PostgresContainerConfig;
@@ -59,6 +60,22 @@ class CanonicalImportIntegrationTest {
ReflectionTestUtils.setField(orchestrator, "canonicalDir", artifactDir.toString()); ReflectionTestUtils.setField(orchestrator, "canonicalDir", artifactDir.toString());
} }
/**
* The import commits through its own transactions (the orchestrator is not transactional),
* so this test cannot rely on {@code @Transactional} rollback for isolation. Delete the
* committed rows after each test — otherwise the last test's documents (dated 1888-02) and
* persons/tags leak into the shared Testcontainers Postgres and pollute other integration
* tests that assume a known seed (e.g. DocumentDensityIntegrationTest,
* DocumentSearchPagedIntegrationTest). Mirrors the @AfterEach deleteAll convention used by
* DocumentListItemIntegrationTest.
*/
@AfterEach
void cleanup() {
documentRepository.deleteAll();
personRepository.deleteAll();
tagRepository.deleteAll();
}
@Test @Test
void reimport_isIdempotent_noDuplicatePersonsTagsOrDocuments() { void reimport_isIdempotent_noDuplicatePersonsTagsOrDocuments() {
orchestrator.runImport(); orchestrator.runImport();