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
@Order(3001)
void removeSelfRepresentativeRelations() {
assumeThatWeAreImportingControlledTestData();
// this happens if a natural person is marked as 'contractual' for itself
final var idsToRemove = new HashSet<Integer>();
@ -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<Integer>();
@ -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<Integer>();
@ -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<Integer>();
@ -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