libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 0f90e125c61f1794ae75b2a41ff5b3d4fadc5d5e
parent 4bcafa4eb29eceec465edeaa2f4ec80681c529fd
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Tue, 12 Nov 2019 13:42:31 +0100

new (failing) unit test

Diffstat:
Msandbox/src/test/kotlin/XmlUtilTest.kt | 49+++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+), 0 deletions(-)

diff --git a/sandbox/src/test/kotlin/XmlUtilTest.kt b/sandbox/src/test/kotlin/XmlUtilTest.kt @@ -5,6 +5,7 @@ import org.junit.Assert.* import org.junit.rules.ExpectedException import org.xml.sax.SAXParseException import tech.libeufin.schema.ebics_h004.EbicsKeyManagementResponse +import tech.libeufin.schema.ebics_h004.HTDResponseOrderData import java.rmi.UnmarshalException import java.security.KeyPairGenerator import java.util.* @@ -13,6 +14,54 @@ import javax.xml.transform.stream.StreamSource class XmlUtilTest { @Test + fun deserializeConsecutiveLists() { + XMLUtil.convertStringToJaxb<HTDResponseOrderData>(""" + <?xml version="1.0" encoding="UTF-8" standalone="yes"?> + <HTDResponseOrderData xmlns="urn:org:ebics:H004"> + <PartnerInfo> + <AddressInfo> + <Name>Foo</Name> + </AddressInfo> + <BankInfo> + <HostID>host01</HostID> + </BankInfo> + <AccountInfo Currency="EUR" Description="ACCT" ID="acctid1"> + <AccountNumber international="true">DE21500105174751659277</AccountNumber> + <BankCode international="true">INGDDEFFXXX</BankCode> + <AccountHolder>Mina Musterfrau</AccountHolder> + </AccountInfo> + <AccountInfo Currency="EUR" Description="glsdemoacct" ID="glsdemo"> + <AccountNumber international="true">DE91430609670123123123</AccountNumber> + <BankCode international="true">GENODEM1GLS</BankCode> + <AccountHolder>Mina Musterfrau</AccountHolder> + </AccountInfo> + <OrderInfo> + <OrderType>C53</OrderType> + <TransferType>Download</TransferType> + <Description>foo</Description> + </OrderInfo> + <OrderInfo> + <OrderType>C52</OrderType> + <TransferType>Download</TransferType> + <Description>foo</Description> + </OrderInfo> + <OrderInfo> + <OrderType>CCC</OrderType> + <TransferType>Upload</TransferType> + <Description>foo</Description> + </OrderInfo> + </PartnerInfo> + <UserInfo> + <UserID Status="5">USER1</UserID> + <Name>Some User</Name> + <Permission> + <OrderTypes>C54 C53 C52 CCC</OrderTypes> + </Permission> + </UserInfo> + </HTDResponseOrderData>""".trimIndent()) + } + + @Test fun exceptionOnConversion() { try { XMLUtil.convertStringToJaxb<EbicsKeyManagementResponse>("<malformed xml>")