package com.brilliance.isc.convert.mt7xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.commontag.ActnoBicAdrTagXXX;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT775Creator;
import org.junit.Test;

/**
 * @author wuzhe
 * @date 2023/02/27
 */
public class MT775Test {

    @Test
    public void mt775_Test(){

        MT775Creator mt775Creator=new MT775Creator("775");
        mt775Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt775Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //27 1!n/1!n
        mt775Creator.setSequenceofTotal("1/1");
        //20 16x
        mt775Creator.setUndertakingNumber("OVFMEEDFGBD");
        //21 16x
        mt775Creator.setRelatedReference("TERSEACSDVF");
        //26E 3n
        mt775Creator.setNumberofAmendment("342");
        //52a 52A
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        issuer.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        //issuer.setAddress("EBAF\r\nBGDFS");//52D Address 4*35x
        mt775Creator.setIssuer(issuer);

        //非必选项
        //77U 150*65z
        mt775Creator.setOtherAmendmentstoUndertaking("DBNHYTGFDSBF");
        //77L 150*65z
        mt775Creator.setOtherAmendmentstoLocalUndertaking("775");

        MtCreatorManager.packMT(mt775Creator);
    }

    @Test
    public void mt775_Test1(){

        MT775Creator mt775Creator=new MT775Creator("775");
        mt775Creator.setSendBic("PSBCCNBJXXX");//发报行
        mt775Creator.setRecvBic("CIPSCNSHXXX");//收报行
        //27 1!n/1!n
        mt775Creator.setSequenceofTotal("1/1");
        //20 16x
        mt775Creator.setUndertakingNumber("OVFMEEDFGBD");
        //21 16x
        mt775Creator.setRelatedReference("TERSEACSDVF");
        //26E 3n
        mt775Creator.setNumberofAmendment("342");
        //52a 52D
        ActnoBicAdrTagXXX issuer = new ActnoBicAdrTagXXX("52");
        issuer.setPartyIdentifier("CNBANKWHLOCAL");//Party Identifier [/1!a][/34x]
        //issuer.setBic("NWBKGB2L");//52A BIC 4!a2!a2!c[3!c]
        issuer.setAddress("EBAF\r\nBGDFS");//52D Address 4*35x
        mt775Creator.setIssuer(issuer);

        //非必选项
        //77U 150*65z
        mt775Creator.setOtherAmendmentstoUndertaking("DBNHYTGFDSBF");
        //77L 150*65z
        mt775Creator.setOtherAmendmentstoLocalUndertaking("775");

        MtCreatorManager.packMT(mt775Creator);
    }
}

