Michael Hoennig
2022-10-30 e9984c3b7c9e67a953d234a8fe01c222ac9cf795
add some asserts to sepa mandate import
1 files modified
22 ■■■■■ changed files
src/test/java/net/hostsharing/hsadminng/hs/office/migration/ImportBusinessPartners.java 22 ●●●●● patch | view | raw | blame | history
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