package com.brilliance.isc.convert.mt1xx;
import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.ActnoBicAdrTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.commontag.DcDateCurAmtTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT103REMITCreator;
import org.junit.Test;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author liusheng
 * @date 2023/2/27
 */

public class MT103REMITTest {
    @Test
    public void mt103_REMIT_Test() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        LinkedList<String> tag13C = new LinkedList<>();
        tag13C.add("/CLSTIME/0915+0200");
        tag13C.add("/CLSTIME/0915+0300");
        mt103_remitCreator.setTimeIndication(tag13C);
        //23B
        mt103_remitCreator.setBankOperationCode("CRED");
        //23E
        LinkedList<String> tag23E = new LinkedList<>();
        tag23E.add("TELI/3226553478");
        tag23E.add("TELL/1234567890");
        mt103_remitCreator.setInstructionCode(tag23E);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateAmt = new DcDateCurAmtTagXXX("32");
        valDateAmt.setCurrency("CNY");
        valDateAmt.setAmount(new BigDecimal("10000.00"));
        valDateAmt.setDate("201231");
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateAmt);
        //33B
        DcDateCurAmtTagXXX curInsAmt = new DcDateCurAmtTagXXX("33");
        curInsAmt.setCurrency("CNY");
        curInsAmt.setAmount(new BigDecimal("20000.00"));
        curInsAmt.setDate("220101");
        mt103_remitCreator.setCurrencyInstructedAmount(curInsAmt);
        //36
//        mt103_remitCreator.setExchangeRate("0,9236");
        //50a-F
        ActnoBicAdrTagXXX actnoBicAdrTag50a = new ActnoBicAdrTagXXX("50");
        actnoBicAdrTag50a.setInfo("F");
        actnoBicAdrTag50a.setPartyIdentifier("NIDN/DE/121231234342");
        actnoBicAdrTag50a.setAddress("1/MANN GEORG");
        mt103_remitCreator.setOrderingCustomer(actnoBicAdrTag50a);
        //50a-A
//        ActnoBicAdrTagXXX actnoBicAdrTag50A = new ActnoBicAdrTagXXX("50");
//        actnoBicAdrTag50A.setInfo("A");
//        actnoBicAdrTag50A.setAcctno(("293456-1254349-82"));
//        actnoBicAdrTag50A.setBic("VISTUS31");
//        mt103_remitCreator.setActnoBicAdrTag50a(actnoBicAdrTag50A);
        //51A
        ActnoBicAdrTagXXX actnoBicAdrTag51A = new ActnoBicAdrTagXXX("51");
        actnoBicAdrTag51A.setBic("ABNANL2A");
        mt103_remitCreator.setSendingInstitution(actnoBicAdrTag51A);
        //52a-A
//        ActnoBicAdrTagXXX actnoBicAdrTag52a = new ActnoBicAdrTagXXX("52");
//        actnoBicAdrTag52a.setInfo("A");
//        actnoBicAdrTag52a.setBic("ABNANL2A");
//        mt103_remitCreator.setActnoBicAdrTag52a(actnoBicAdrTag52a);
        //52a-D
        ActnoBicAdrTagXXX actnoBicAdrTag52aD = new ActnoBicAdrTagXXX("52");
        actnoBicAdrTag52aD.setInfo("D");
        actnoBicAdrTag52aD.setAddress("1Country");
        mt103_remitCreator.setOrderingInstitution(actnoBicAdrTag52aD);
        //53a
        ActnoBicAdrTagXXX actnoBicAdrTag53a = new ActnoBicAdrTagXXX("53");
        actnoBicAdrTag53a.setBic("ABNANL2A");
        mt103_remitCreator.setSendersCorrespondent(actnoBicAdrTag53a);
        //54a
        ActnoBicAdrTagXXX actnoBicAdrTag54a = new ActnoBicAdrTagXXX("54");
        actnoBicAdrTag54a.setBic("IRVTUS3N");
        mt103_remitCreator.setReceiversCorrespondent(actnoBicAdrTag54a);
        //55a
        ActnoBicAdrTagXXX actnoBicAdrTag55a = new ActnoBicAdrTagXXX("55");
        actnoBicAdrTag55a.setLocation("Location55B");
        mt103_remitCreator.setThirdReimbursementInstitution(actnoBicAdrTag55a);
        //56a
        ActnoBicAdrTagXXX actnoBicAdrTag56a = new ActnoBicAdrTagXXX("56");
        actnoBicAdrTag56a.setBic("IRVTUS3N");
        mt103_remitCreator.setIntermediaryInstitution(actnoBicAdrTag56a);
        //57a
        ActnoBicAdrTagXXX actnoBicAdrTag57a = new ActnoBicAdrTagXXX("57");
        actnoBicAdrTag57a.setBic("ABNANL2A");
        mt103_remitCreator.setAccountWithInstitution(actnoBicAdrTag57a);
        //59a
        ActnoBicAdrTagXXX actnoBicAdrTag59a = new ActnoBicAdrTagXXX("59");
        actnoBicAdrTag59a.setAcctno("/BE62510007547061");
        actnoBicAdrTag59a.setAddress("JOHANN WILLEMS");
        mt103_remitCreator.setBeneficiaryCustomer(actnoBicAdrTag59a);
        //71A
        mt103_remitCreator.setDetailsOfCharges("BEN");
        //71F
        LinkedList<String> tag71F = new LinkedList<>();
        tag71F.add("EUR8,00");
        tag71F.add("EUR9,00");
        mt103_remitCreator.setSendersCharges(tag71F);
        //71G
        mt103_remitCreator.setReceiversCharges("EUR5,50");
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/INS/ABNANL2A");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");
        //77T
        mt103_remitCreator.setEnvelopeContents("/UEDI/UNH+123A5+FINPAY:D:98A:UN'DOC+ ...");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //数据格式和业务逻辑均正确的测试方法。
    @Test
    public void MT103_REMIT_TEST_1() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("CRED");
        //23E
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("CHQB");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("EUR");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        mt103_remitCreator.setExchangeRate("7.00");
        //50a A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("CHASUS33XXX");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setBic("IRVTUS3NXXX");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a A
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setBic("HSBCHKHHHKH");
        sendersCorrespondent.setInfo("C");
        sendersCorrespondent.setPartyIdentifier("53A_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a A
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setBic("CITIUS33XXX");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54A_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a A
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setBic("BARCHKHHXXX");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55A_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a A
        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
        intermediaryInstitution.setBic("DHBKHKHHXXX");
        intermediaryInstitution.setInfo("C");
        intermediaryInstitution.setPartyIdentifier("56A_PartyIdentifier");
        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a A
        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
        accountWithInstitution.setBic("BKTRUS33XXX");
        accountWithInstitution.setInfo("D");
        accountWithInstitution.setPartyIdentifier("57A_PartyIdentifier");
        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a No Letter Option
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAddress("59_Address");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("OUR");
        //71F 71A为OUR时，此标签不能存在
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G
        mt103_remitCreator.setReceiversCharges("CNY200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");
        //77T
        mt103_remitCreator.setEnvelopeContents("This is Envelope Contents.");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //数据格式和业务逻辑均正确的测试方法。
    @Test
    public void MT103_REMIT_TEST_2() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("CRED");
        //23E
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("HOLD");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("TRN");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("EUR");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        mt103_remitCreator.setExchangeRate("7.00");
        //50a F
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setAddress("1/50F_Address1");
        orderingCustomer.setPartyIdentifier("50F_PartyIdentifier");
        orderingCustomer.setInfo("C");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a D
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52D_PartyIdentifier");
        orderingInstitution.setAddress("52D_Address1");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a B
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setLocation("53B_Location");
        sendersCorrespondent.setInfo("C");
        sendersCorrespondent.setPartyIdentifier("53B_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a B
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setLocation("54B_Location");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54B_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a B
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setLocation("55B_Location");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55B_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a D
        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
        intermediaryInstitution.setInfo("D");
        intermediaryInstitution.setPartyIdentifier("56D_PartyIdentifier");
        intermediaryInstitution.setAddress("56D_Address");
        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a B
        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
        accountWithInstitution.setLocation("57B_Location");
        accountWithInstitution.setInfo("D");
        accountWithInstitution.setPartyIdentifier("57B_PartyIdentifier");
        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a A
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAcctno("59A_Account");
        beneficiaryCustomer.setBic("CITIUS33XXX");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("SHA");
        //71F
        List<String> sendersChargeList = new ArrayList<>();
        sendersChargeList.add("CNY1000,");
        sendersChargeList.add("EUR1000,50");
        mt103_remitCreator.setSendersCharges(sendersChargeList);
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G 71A为SHA时，此标签不能存在。
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");
        //77T
        mt103_remitCreator.setEnvelopeContents("This is Envelope Contents.");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //数据格式和业务逻辑均正确的测试方法。
    @Test
    public void MT103_REMIT_TEST_3() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("CRED");
        //23E
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("HOLD");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("EUR");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        mt103_remitCreator.setExchangeRate("7.00");
        //50a K
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setAddress("50K_Address1");
        orderingCustomer.setAcctno("50K_Account");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a D
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52D_PartyIdentifier");
        orderingInstitution.setAddress("52D_Address1");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a D
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setAddress("53D_Address");
        sendersCorrespondent.setInfo("C");
        sendersCorrespondent.setPartyIdentifier("53D_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a D
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setAddress("54D_Address");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54D_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a D
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setAddress("55D_Address");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55D_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a C
        //TODO 56C暂时不考虑，此处测试暂时搁置。
//        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
//        intermediaryInstitution.setInfo("D");
//        intermediaryInstitution.setPartyIdentifier("56C_PartyIdentifier");
//        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a C
        //TODO 57C暂时不考虑，此处测试暂时搁置。
//        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
//        accountWithInstitution.setInfo("D");
//        accountWithInstitution.setPartyIdentifier("57C_PartyIdentifier");
//        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a F
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAcctno("59F_Account");
        beneficiaryCustomer.setAddress("1/59F_Address");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("BEN");
        //71F 71A为BEN时，此标签必须存在。
        List<String> sendersChargeList = new ArrayList<>();
        sendersChargeList.add("CNY1000,");
        sendersChargeList.add("EUR1000,50");
        mt103_remitCreator.setSendersCharges(sendersChargeList);
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G 71A为BEN时，此标签不能存在。
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //数据格式不正确的测试方法。
    @Test
    public void MT103_REMIT_TEST_4() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20 字段过长
        mt103_remitCreator.setSendersReference("12345678901234567890");
        //13C 字段过长
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIMETIME/0915+0100");
        timeIndications.add("/RNCTIMETIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B 字段过长
        mt103_remitCreator.setBankOperationCode("CREDA");
        //23E 出现非数字、字母字符
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("/][-");
        instructionCodes.add("!@#$");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T 出现非数字、字母字符
        mt103_remitCreator.setTransactionTypeCode(")(*");
        //32A Date字段超长，Currency出现非字母字符
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("20201231");
        valDateCurAmt.setCurrency("123");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B Currency出现非字母字符
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("456");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36 出现非数字及小数点字符
        mt103_remitCreator.setExchangeRate("rate");
        //50a A BIC格式错误
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("SWIFT123BCBIC");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A BIC格式错误
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("SWIFT456BICBC");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a D Address字段超长
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setAddress("1234567890223456789032345678904234567890");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a B Location字段超长
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setLocation("1234567890223456789032345678904234567890");
        sendersCorrespondent.setInfo("C");
        sendersCorrespondent.setPartyIdentifier("53A_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a D Info格式错误
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setBic("CITIUS33XXX");
        receiversCorrespondent.setInfo("ABCDFGH");
        receiversCorrespondent.setPartyIdentifier("54A_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //71A 出现非字母字符
        mt103_remitCreator.setDetailsOfCharges("123");
        //71F Amount字段超长
        List<String> sendersChargeList = new ArrayList<>();
        sendersChargeList.add("CNY10000000,0000000");
        sendersChargeList.add("EUR1000,50");
        mt103_remitCreator.setSendersCharges(sendersChargeList);
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G Cur出现非字母字符
        mt103_remitCreator.setReceiversCharges("】【、200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72 字段超长
        mt103_remitCreator.setSenderToReceiverInformation("1234567890223456789032345678904234567890");
        //77B 字段超长
        mt103_remitCreator.setRegulatoryReporting("1234567890223456789032345678904234567890");

        MtCreatorManager.packMT(mt103_remitCreator);

    }

    //不符合业务逻辑C1, C3, C4, C6, C8, C9, C10, C12, C14, C17, C18的测试方法。
    @Test
    public void MT103_REMIT_TEST_5() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("SPRI");
        //23E C3.23B的值为SPRI时，23E中出现了SDVA, TELB, PHOB, INTC之外的值。
        // C17.当57a不存在时，23E不能包含TELE和PHON.
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("TELE");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B C1.33B存在且2A和33B币种不同时，36必须存在。
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("EUR");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
//        mt103_remitCreator.setExchangeRate("7.00");
        //50a A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("CHASUS33XXX");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setBic("IRVTUS3NXXX");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a D
        // C4.当23B的值为SPRI, SSTD, SPAY的其中一个时，53a域不能选择53D.
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setAddress("53D_Address");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a A
        // C6.23B的值为SPRI, SSTD, SPAY时，54a域必须选择54A.
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setAddress("54D_Address");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54D_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a A
        // C8.23B的值为SPRI, SSTD, SPAY时，必须使用55A.
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setLocation("55B_Location");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55B_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a A
        // C10.23B的值为SPRI时，56a域不能存在。
        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
        intermediaryInstitution.setBic("DHBKHKHHXXX");
        intermediaryInstitution.setInfo("C");
        intermediaryInstitution.setPartyIdentifier("56A_PartyIdentifier");
        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a A
        // C9.56a存在时，57a不能为空。
//        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
//        accountWithInstitution.setBic("BKTRUS33XXX");
//        accountWithInstitution.setInfo("D");
//        accountWithInstitution.setPartyIdentifier("57A_PartyIdentifier");
//        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a No Letter Option
        // C12.23B的值为SPRI, SSTD, SPAY时，59a必须填写Account.
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAddress("59_Address");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("OUR");
        //71F C14.当71A的值为OUR时，71F不能存在。
        List<String> sendersChargeList = new ArrayList<>();
        sendersChargeList.add("CNY1000,");
        sendersChargeList.add("EUR1000,50");
        mt103_remitCreator.setSendersCharges(sendersChargeList);
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G C18.71G和32A的币种必须相同。
        mt103_remitCreator.setReceiversCharges("EUR200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //不符合业务逻辑C1, C2, C3, C5, C6, C8, C10, C11, C14, C15的测试方法。
    @Test
    public void MT103_REMIT_TEST_6() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        mt103_remitCreator.setSendBic("BINAADB1XXX");
        mt103_remitCreator.setRecvBic("VALBADADXXX");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("SSTD");
        //23E
        // C2.23B的值为SSTD或SPAY时，23E不能存在。
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("CHQB");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        // C2.发报行和收报行同时属于以下国家/地区时：
        // AD, AT, BE, BG, BV, CH, CY, CZ, DE, DK, ES, EE, FI, FR, GB, GF, GI, GP, GR, HU, IE, IS, IT,
        // LI, LT, LU, LV, MC, MQ, MT, NL, NO, PL, PM, PT, RE, RO, SE, SI, SJ, SK, SM, TF, VA.
        // 33B必须存在。
        // C15.当71F或71G存在时，33B必须存在。

//        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
//        currencyInstructedAmount.setCurrency("EUR");
//        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
//        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        // C1.当33B不存在时，36不能存在。
        mt103_remitCreator.setExchangeRate("7.00");
        //50a A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("CHASUS33XXX");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setBic("IRVTUS3NXXX");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a B
        // C5.23B的值为SPRI, SSTD, SPAY时，53B必须填写Party Identifier.
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setLocation("53B_Location");
//        sendersCorrespondent.setInfo("C");
//        sendersCorrespondent.setPartyIdentifier("53B_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a D
        // C6.23B的值为SPRI, SSTD, SPAY时，不能使用54A和54D.
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54D_PartyIdentifier");
        receiversCorrespondent.setAddress("54D_Address");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a D
        // C8.23B的值为SPRI, SSTD, SPAY时，必须使用55A.
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setAddress("55D_Address");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55D_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a D
        // C10.23B的值为SSTD或SPAY，56a域只能选择56A和56C.
        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
        intermediaryInstitution.setAddress("56D_Address");
        intermediaryInstitution.setInfo("C");
        intermediaryInstitution.setPartyIdentifier("56A_PartyIdentifier");
        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a B
        //C11 23B的值为SPRI, SSTD, SPAY时，57a只能选择57A, 57C, 57D.
        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
        accountWithInstitution.setLocation("57B_Location");
        accountWithInstitution.setInfo("D");
        accountWithInstitution.setPartyIdentifier("57B_PartyIdentifier");
        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a No Letter Option
        // C12.23B的值为SPRI, SSTD, SPAY时，59a必须填写Account.
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAddress("59_Address");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("SHA");
        //71F
        List<String> sendersChargeList = new ArrayList<>();
        sendersChargeList.add("CNY1000,");
        sendersChargeList.add("EUR1000,50");
        mt103_remitCreator.setSendersCharges(sendersChargeList);
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G
        // C14.当71A的值为SHA时，71G不能存在。
        mt103_remitCreator.setReceiversCharges("CNY200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");

        MtCreatorManager.packMT(mt103_remitCreator);

    }

    //不符合业务逻辑C1, C3, C7, C10, C11, C13, C14的测试方法。
    @Test
    public void MT103_REMIT_TEST_7() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("SPRI");
        //23E
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("CHQB");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("CNY");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        // C1.当32A和33B币种相同时，36不能存在，
        mt103_remitCreator.setExchangeRate("7.00");
        //50a A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("CHASUS33XXX");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setBic("IRVTUS3NXXX");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
//        //53a A
//        //C7.55a存在时，53a和54a不能为空。
//        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
//        sendersCorrespondent.setBic("HSBCHKHHHKH");
//        sendersCorrespondent.setInfo("C");
//        sendersCorrespondent.setPartyIdentifier("53A_PartyIdentifier");
//        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
//        //54a A
//        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
//        receiversCorrespondent.setBic("CITIUS33XXX");
//        receiversCorrespondent.setInfo("C");
//        receiversCorrespondent.setPartyIdentifier("54A_PartyIdentifier");
//        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a A
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setBic("BARCHKHHXXX");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55A_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a B
        // C10.23B的值为SPRI时，56a域不能存在。
        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
        intermediaryInstitution.setBic("DHBKHKHHXXX");
        intermediaryInstitution.setInfo("C");
        intermediaryInstitution.setPartyIdentifier("56A_PartyIdentifier");
        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a D
        // 23B的值为SPRI, SSTD, SPAY时，57D必须使用Party Identifier.
        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
        accountWithInstitution.setAddress("57D_Address");
//        accountWithInstitution.setInfo("D");
//        accountWithInstitution.setPartyIdentifier("57A_PartyIdentifier");
        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a No Letter Option
        // C13.当有23E的值为CHQB时，59a不能填写Account.
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAddress("59_Address");
        beneficiaryCustomer.setAcctno("59_Account");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        // C14.当71A的值为BEN时，71F必须存在，71G不能存在。
        mt103_remitCreator.setDetailsOfCharges("BEN");
        //71F 71A为OUR时，此标签不能存在
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G
        mt103_remitCreator.setReceiversCharges("CNY200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

    //不符合业务逻辑C16的测试方法。
    @Test
    public void MT103_REMIT_TEST_8() throws Exception {
        MT103REMITCreator mt103_remitCreator = new MT103REMITCreator("103_REMIT");
        //20
        mt103_remitCreator.setSendersReference("SendersReference");
        //13C
        List<String> timeIndications = new ArrayList<>();
        timeIndications.add("/CLSTIME/0915+0100");
        timeIndications.add("/RNCTIME/1030-0200");
        mt103_remitCreator.setTimeIndication(timeIndications);
        //23B
        mt103_remitCreator.setBankOperationCode("CRED");
        //23E
        List<String> instructionCodes = new ArrayList<>();
        instructionCodes.add("TELI");
        instructionCodes.add("CORT");
        mt103_remitCreator.setInstructionCode(instructionCodes);
        //26T
        mt103_remitCreator.setTransactionTypeCode("K90");
        //32A
        DcDateCurAmtTagXXX valDateCurAmt = new DcDateCurAmtTagXXX("32");
        valDateCurAmt.setDate("201231");
        valDateCurAmt.setCurrency("CNY");
        valDateCurAmt.setAmount(new BigDecimal("10000"));
        mt103_remitCreator.setValueDateCurrencyInterbankSettledAmount(valDateCurAmt);
        //33B
        DcDateCurAmtTagXXX currencyInstructedAmount = new DcDateCurAmtTagXXX("33");
        currencyInstructedAmount.setCurrency("EUR");
        currencyInstructedAmount.setAmount(new BigDecimal("100.00"));
        mt103_remitCreator.setCurrencyInstructedAmount(currencyInstructedAmount);
        //36
        mt103_remitCreator.setExchangeRate("7.00");
        //50a A
        ActnoBicAdrTagXXX orderingCustomer = new ActnoBicAdrTagXXX("50", "103_REMIT");
        orderingCustomer.setBic("CHASUS33XXX");
        orderingCustomer.setAcctno("50AAccount");
        mt103_remitCreator.setOrderingCustomer(orderingCustomer);
        //51A
        ActnoBicAdrTagXXX sendingInstitution = new ActnoBicAdrTagXXX("51");
        sendingInstitution.setBic("BOFAUS3NXXX");
        sendingInstitution.setPartyIdentifier("51A_PartyIdentifier");
        mt103_remitCreator.setSendingInstitution(sendingInstitution);
        //52a A
        ActnoBicAdrTagXXX orderingInstitution = new ActnoBicAdrTagXXX("52");
        orderingInstitution.setPartyIdentifier("52A_PartyIdentifier");
        orderingInstitution.setBic("IRVTUS3NXXX");
        mt103_remitCreator.setOrderingInstitution(orderingInstitution);
        //53a A
        ActnoBicAdrTagXXX sendersCorrespondent = new ActnoBicAdrTagXXX("53");
        sendersCorrespondent.setBic("HSBCHKHHHKH");
        sendersCorrespondent.setInfo("C");
        sendersCorrespondent.setPartyIdentifier("53A_PartyIdentifier");
        mt103_remitCreator.setSendersCorrespondent(sendersCorrespondent);
        //54a A
        ActnoBicAdrTagXXX receiversCorrespondent = new ActnoBicAdrTagXXX("54");
        receiversCorrespondent.setBic("CITIUS33XXX");
        receiversCorrespondent.setInfo("C");
        receiversCorrespondent.setPartyIdentifier("54A_PartyIdentifier");
        mt103_remitCreator.setReceiversCorrespondent(receiversCorrespondent);
        //55a A
        ActnoBicAdrTagXXX thirdReimbursementInstitution = new ActnoBicAdrTagXXX("55");
        thirdReimbursementInstitution.setBic("BARCHKHHXXX");
        thirdReimbursementInstitution.setInfo("D");
        thirdReimbursementInstitution.setPartyIdentifier("55A_PartyIdentifier");
        mt103_remitCreator.setThirdReimbursementInstitution(thirdReimbursementInstitution);
        //56a A
        //C16.当56a不存在时，23E不能填写TELI或PHOI。不符合时报错E44.
//        ActnoBicAdrTagXXX intermediaryInstitution = new ActnoBicAdrTagXXX("56");
//        intermediaryInstitution.setBic("DHBKHKHHXXX");
//        intermediaryInstitution.setInfo("C");
//        intermediaryInstitution.setPartyIdentifier("56A_PartyIdentifier");
//        mt103_remitCreator.setIntermediaryInstitution(intermediaryInstitution);
        //57a A
        ActnoBicAdrTagXXX accountWithInstitution = new ActnoBicAdrTagXXX("57");
        accountWithInstitution.setBic("BKTRUS33XXX");
        accountWithInstitution.setInfo("D");
        accountWithInstitution.setPartyIdentifier("57A_PartyIdentifier");
        mt103_remitCreator.setAccountWithInstitution(accountWithInstitution);
        //59a No Letter Option
        ActnoBicAdrTagXXX beneficiaryCustomer = new ActnoBicAdrTagXXX("59", "103_REMIT");
        beneficiaryCustomer.setAddress("59_Address");
        mt103_remitCreator.setBeneficiaryCustomer(beneficiaryCustomer);
        //71A
        mt103_remitCreator.setDetailsOfCharges("OUR");
        //71F 71A为OUR时，此标签不能存在
/*        List<DcDateCurAmtTagXXX> sendersChargeList = new ArrayList<>();
        DcDateCurAmtTagXXX sendersCharge1 = new DcDateCurAmtTagXXX("71");
        DcDateCurAmtTagXXX sendersCharge2 = new DcDateCurAmtTagXXX("71");
        sendersCharge1.setCurrency("CNY");
        sendersCharge1.setAmount(new BigDecimal("123.45"));
        sendersCharge2.setCurrency("USD");
        sendersCharge2.setAmount(new BigDecimal("1000"));
        sendersChargeList.add(sendersCharge1);
        sendersChargeList.add(sendersCharge2);
        mt103_remitCreator.setSendersCharges(sendersChargeList);*/
        //71G
        mt103_remitCreator.setReceiversCharges("CNY200,99");
/*        DcDateCurAmtTagXXX receiversCharge = new DcDateCurAmtTagXXX("71");
        receiversCharge.setCurrency("EUR");
        receiversCharge.setAmount(new BigDecimal("200.99"));
        mt103_remitCreator.setReceiversCharges(receiversCharge);*/
        //72
        mt103_remitCreator.setSenderToReceiverInformation("/ACC/AddonInformation\r\n/INS/AddonInformation2");
        //77B
        mt103_remitCreator.setRegulatoryReporting("/ORDERRES/BE//MEILAAN 1, 9000 GENT");

        MtCreatorManager.packMT(mt103_remitCreator);
    }

}
