cleanups in ImportOfficeData also need to apply to real import, not just test-data

This commit is contained in:
Michael Hoennig 2024-04-11 13:48:29 +02:00
parent 9f0af9274f
commit 178930a019

View File

@ -433,7 +433,6 @@ public class ImportOfficeData extends ContextBasedTest {
@Test @Test
@Order(3001) @Order(3001)
void removeSelfRepresentativeRelations() { void removeSelfRepresentativeRelations() {
assumeThatWeAreImportingControlledTestData();
// this happens if a natural person is marked as 'contractual' for itself // this happens if a natural person is marked as 'contractual' for itself
final var idsToRemove = new HashSet<Integer>(); final var idsToRemove = new HashSet<Integer>();
@ -453,7 +452,6 @@ public class ImportOfficeData extends ContextBasedTest {
@Test @Test
@Order(3002) @Order(3002)
void removeEmptyRelations() { void removeEmptyRelations() {
assumeThatWeAreImportingControlledTestData();
// avoid a error when persisting the deliberately invalid partner entry #99 // avoid a error when persisting the deliberately invalid partner entry #99
final var idsToRemove = new HashSet<Integer>(); final var idsToRemove = new HashSet<Integer>();
@ -474,7 +472,6 @@ public class ImportOfficeData extends ContextBasedTest {
@Test @Test
@Order(3003) @Order(3003)
void removeEmptyPartners() { void removeEmptyPartners() {
assumeThatWeAreImportingControlledTestData();
// avoid a error when persisting the deliberately invalid partner entry #99 // avoid a error when persisting the deliberately invalid partner entry #99
final var idsToRemove = new HashSet<Integer>(); final var idsToRemove = new HashSet<Integer>();
@ -498,7 +495,6 @@ public class ImportOfficeData extends ContextBasedTest {
@Test @Test
@Order(3004) @Order(3004)
void removeEmptyDebitors() { void removeEmptyDebitors() {
assumeThatWeAreImportingControlledTestData();
// avoid a error when persisting the deliberately invalid partner entry #99 // avoid a error when persisting the deliberately invalid partner entry #99
final var idsToRemove = new HashSet<Integer>(); final var idsToRemove = new HashSet<Integer>();
@ -510,8 +506,10 @@ public class ImportOfficeData extends ContextBasedTest {
idsToRemove.add(id); idsToRemove.add(id);
} }
}); });
assertThat(idsToRemove.size()).isEqualTo(1); // only from partner #99
idsToRemove.forEach(id -> debitors.remove(id)); idsToRemove.forEach(id -> debitors.remove(id));
assumeThatWeAreImportingControlledTestData();
assertThat(idsToRemove.size()).isEqualTo(1); // only from partner #99
} }
@Test @Test