From e9984c3b7c9e67a953d234a8fe01c222ac9cf795 Mon Sep 17 00:00:00 2001
From: Michael Hoennig <michael@hoennig.de>
Date: Sun, 30 Oct 2022 09:14:01 +0100
Subject: [PATCH] add some asserts to sepa mandate import

---
 src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java
index d295b76..16a3570 100644
--- a/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java
+++ b/src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java
@@ -44,6 +44,15 @@
 import static org.apache.commons.lang3.StringUtils.isNotBlank;
 import static org.assertj.core.api.Assertions.assertThat;
 
+/*
+ * This 'test' includes the complete legacy 'office' data import.
+ *
+ * There is no code in 'main' because the import is not needed a normal runtime.
+ * There is some test data in Java resources to verfiy the data conversion.
+ * For a real import a main method will be added later
+ * which reads CSV files from the file system.
+ */
+
 @DataJpaTest
 @Import({ Context.class, JpaAttempt.class })
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@@ -144,6 +153,19 @@
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
+
+        assertThat(bankAccounts.toString()).isEqualToIgnoringWhitespace("""
+                {
+                    234234=bankAccount(holder='Michael Mellies', iban='DE37500105177419788228', bic='INGDDEFFXXX'), 
+                    235662=bankAccount(holder='JM e.K.', iban='DE49500105174516484892', bic='INGDDEFFXXX')
+                }
+                """);
+        assertThat(sepaMandates.toString()).isEqualToIgnoringWhitespace("""
+                {
+                    234234=SEPA-Mandate(DE37500105177419788228, MH12345, 2004-06-12, [2004-06-15,)), 
+                    235662=SEPA-Mandate(DE49500105174516484892, JM33344, 2005-06-28, [2005-07-01,))
+                }
+                """);
     }
 
     @Test

--
Gitblit v1.9.3