-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry pick changes from PR CU-86b1kajgv_PW-1958--NullPointerExceptio…
…n-in-MxSwiftMessageapplyStra
- Loading branch information
Showing
3 changed files
with
125 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
iso20022-core/src/test/java/com/prowidesoftware/issues/Issue1958.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package com.prowidesoftware.issues; | ||
|
||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import com.prowidesoftware.swift.model.MxSwiftMessage; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class Issue1958 { | ||
|
||
@Test | ||
void test() { | ||
try { | ||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" | ||
+ "<RequestPayload>" | ||
+ "<h:AppHdr xmlns:h=\"urn:swift:xsd:$ahV10\">" | ||
+ " <h:From>" | ||
+ " <h:Type>BIC</h:Type>" | ||
+ " <h:Id>AAAANGL0XXX</h:Id>" | ||
+ " </h:From>" | ||
+ " <h:To>" | ||
+ " <h:Type>BIC</h:Type>" | ||
+ " <h:Id>BBBBUS33XXX</h:Id>" | ||
+ " </h:To>" | ||
+ " <h:MsgName>pacs.008.001.08</h:MsgName>" | ||
+ " <h:MsgRef>FOOBAR1</h:MsgRef>" | ||
+ " <h:CrDate>2022-05-05T06:07:14Z</h:CrDate>" | ||
+ "</h:AppHdr>" | ||
+ "<Doc:Document xmlns:Doc=\"urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08\">" | ||
+ " <Doc:FIToFICstmrCdtTrf>" | ||
+ " <Doc:GrpHdr>" | ||
+ " <Doc:MsgId>FOOBAR2</Doc:MsgId>" | ||
+ " <Doc:CreDtTm>2022-05-05T06:07:14Z</Doc:CreDtTm>" | ||
+ " <Doc:NbOfTxs>1</Doc:NbOfTxs>" | ||
+ " <Doc:SttlmInf>" | ||
+ " <Doc:SttlmMtd>INDA</Doc:SttlmMtd>" | ||
+ " <Doc:SttlmAcct>" | ||
+ " <Doc:Id>" | ||
+ " <Doc:Othr>" | ||
+ " <Doc:Id>04435001</Doc:Id>" | ||
+ " </Doc:Othr>" | ||
+ " </Doc:Id>" | ||
+ " </Doc:SttlmAcct>" | ||
+ " </Doc:SttlmInf>" | ||
+ " <Doc:InstgAgt>" | ||
+ " <Doc:FinInstnId>" | ||
+ " <Doc:BICFI>AAAANGL0XXX</Doc:BICFI>" | ||
+ " </Doc:FinInstnId>" | ||
+ " </Doc:InstgAgt>" | ||
+ " <Doc:InstdAgt>" | ||
+ " <Doc:FinInstnId>" | ||
+ " <Doc:BICFI>BBBBUS33XXX</Doc:BICFI>" | ||
+ " </Doc:FinInstnId>" | ||
+ " </Doc:InstdAgt>" | ||
+ " </Doc:GrpHdr>" | ||
+ " <Doc:CdtTrfTxInf>" | ||
+ " <Doc:PmtId>" | ||
+ " <Doc:InstrId>REF333222333</Doc:InstrId>" | ||
+ " <Doc:EndToEndId>RRRR345345</Doc:EndToEndId>" | ||
+ " <Doc:TxId>FFDD34534</Doc:TxId>" | ||
+ " </Doc:PmtId>" | ||
+ " <Doc:IntrBkSttlmAmt Ccy=\"USD\"></Doc:IntrBkSttlmAmt>" | ||
+ " <Doc:IntrBkSttlmDt>2022-05-05</Doc:IntrBkSttlmDt>" | ||
+ " <Doc:InstdAmt Ccy=\"USD\"></Doc:InstdAmt>" | ||
+ " <Doc:ChrgBr>DEBT</Doc:ChrgBr>" | ||
+ " <Doc:Dbtr>" | ||
+ " <Doc:Nm>FOO FEED MILLS COLTD</Doc:Nm>" | ||
+ " <Doc:PstlAdr>" | ||
+ " <Doc:AdrLine>1 GOLDEN PENNY PLACE, WHARF ROAD,</Doc:AdrLine>" | ||
+ " <Doc:AdrLine>APAPA LAGOS</Doc:AdrLine>" | ||
+ " </Doc:PstlAdr>" | ||
+ " </Doc:Dbtr>" | ||
+ " <Doc:DbtrAcct>" | ||
+ " <Doc:Id>" | ||
+ " <Doc:Othr>" | ||
+ " <Doc:Id>2028766092</Doc:Id>" | ||
+ " </Doc:Othr>" | ||
+ " </Doc:Id>" | ||
+ " </Doc:DbtrAcct>" | ||
+ " <Doc:DbtrAgt>" | ||
+ " <Doc:FinInstnId>" | ||
+ " <Doc:BICFI>AAAANGLA</Doc:BICFI>" | ||
+ " </Doc:FinInstnId>" | ||
+ " </Doc:DbtrAgt>" | ||
+ " <Doc:CdtrAgt>" | ||
+ " <Doc:FinInstnId>" | ||
+ " <Doc:BICFI>BBBBRU21</Doc:BICFI>" | ||
+ " </Doc:FinInstnId>" | ||
+ " </Doc:CdtrAgt>" | ||
+ " <Doc:Cdtr>" | ||
+ " <Doc:Nm>TEST</Doc:Nm>" | ||
+ " <Doc:PstlAdr>" | ||
+ " <Doc:AdrLine>TEST</Doc:AdrLine>" | ||
+ " </Doc:PstlAdr>" | ||
+ " </Doc:Cdtr>" | ||
+ " <Doc:CdtrAcct>" | ||
+ " <Doc:Id>" | ||
+ " <Doc:Othr>" | ||
+ " <Doc:Id>TEST</Doc:Id>" | ||
+ " </Doc:Othr>" | ||
+ " </Doc:Id>" | ||
+ " </Doc:CdtrAcct>" | ||
+ " <Doc:RmtInf>" | ||
+ " <Doc:Ustrd>AGRICULTURAL SECTOR</Doc:Ustrd>" | ||
+ " </Doc:RmtInf>" | ||
+ " </Doc:CdtTrfTxInf>" | ||
+ " </Doc:FIToFICstmrCdtTrf>" | ||
+ "</Doc:Document>" | ||
+ "</RequestPayload>"; | ||
new MxSwiftMessage(xml); | ||
} catch (Exception e) { | ||
fail(); | ||
} | ||
} | ||
} |