From 178930a0199457870098bb67c88dc445291d2551 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 11 Apr 2024 13:48:29 +0200 Subject: [PATCH] cleanups in ImportOfficeData also need to apply to real import, not just test-data --- .../hsadminng/hs/office/migration/ImportOfficeData.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java index 71a1f2fc..9c248839 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportOfficeData.java @@ -433,7 +433,6 @@ public class ImportOfficeData extends ContextBasedTest { @Test @Order(3001) void removeSelfRepresentativeRelations() { - assumeThatWeAreImportingControlledTestData(); // this happens if a natural person is marked as 'contractual' for itself final var idsToRemove = new HashSet(); @@ -453,7 +452,6 @@ public class ImportOfficeData extends ContextBasedTest { @Test @Order(3002) void removeEmptyRelations() { - assumeThatWeAreImportingControlledTestData(); // avoid a error when persisting the deliberately invalid partner entry #99 final var idsToRemove = new HashSet(); @@ -474,7 +472,6 @@ public class ImportOfficeData extends ContextBasedTest { @Test @Order(3003) void removeEmptyPartners() { - assumeThatWeAreImportingControlledTestData(); // avoid a error when persisting the deliberately invalid partner entry #99 final var idsToRemove = new HashSet(); @@ -498,7 +495,6 @@ public class ImportOfficeData extends ContextBasedTest { @Test @Order(3004) void removeEmptyDebitors() { - assumeThatWeAreImportingControlledTestData(); // avoid a error when persisting the deliberately invalid partner entry #99 final var idsToRemove = new HashSet(); @@ -510,8 +506,10 @@ public class ImportOfficeData extends ContextBasedTest { idsToRemove.add(id); } }); - assertThat(idsToRemove.size()).isEqualTo(1); // only from partner #99 idsToRemove.forEach(id -> debitors.remove(id)); + + assumeThatWeAreImportingControlledTestData(); + assertThat(idsToRemove.size()).isEqualTo(1); // only from partner #99 } @Test