add some asserts to sepa mandate import

This commit is contained in:
Michael Hoennig 2022-10-30 09:14:01 +01:00
parent 1134401310
commit e1dd9b08c2

View File

@ -44,6 +44,15 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.assertj.core.api.Assertions.assertThat; 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 @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@ -144,6 +153,19 @@ public class ImportBusinessPartners extends ContextBasedTest {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(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 @Test