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.MT769Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt7xx.MT787Creator;
import com.brilliance.isc.swift.objmtconvert.result.MtResult;
import com.brilliance.isc.swift.objmtconvert.util.Constans;
import org.junit.Test;

import java.lang.reflect.InvocationTargetException;

public class MT787Test {

    @Test
    public void mt787_Test()throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        //构造参数传入MT报文类型
        MT787Creator mt787Creator = new MT787Creator("787");//报文类型

        ActnoBicAdrTagXXX issuer52a = new ActnoBicAdrTagXXX("52");
        //issuer52a.setInfo("A");
        //issuer52a.setAddress("WHYHCNHBXXX");
        issuer52a.setBic ("GCYXXXXXX52");
        //issuer52a.setAcctno("01111001759234567890");
        issuer52a.setPartyIdentifier("1234-5678");
        //issuer52a.setLocation("WHYHCNHBXXX");


        mt787Creator.setTransactionReferenceNumber("EH Eigert Gmb");//20 16x
        mt787Creator.setRelatedReference("EH Eigert");//12 3!n
        mt787Creator.setIssuer52a(issuer52a);
        mt787Creator.setNumberofAmendment("594");
        mt787Creator.setAmendmentStatus("1234"+ Constans.CRLF+"XJIA");
        mt787Creator.setSendertoReceiverInformation("EH Eigert GmbH\n" + "Hauptstrasse 987\n" + "DE/12345 Mannheim");
        mt787Creator.setFileIdentification("EMAL/Email transfer");
//
        MtResult mtResult = MtCreatorManager.packMT(mt787Creator);
//        MtCreatorManager.packMT(mt769Creator);
    }

    @Test
    public void mt787_1_Test()throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        //构造参数传入MT报文类型
        MT787Creator mt787Creator = new MT787Creator("787");//报文类型

        ActnoBicAdrTagXXX issuer52a = new ActnoBicAdrTagXXX("52");
        //issuer52a.setInfo("A");
        issuer52a.setAddress("WHYHCNHBXXX");
        //issuer52a.setCode("THISIS41A");
        //issuer52a.setBic ("GCYXXXXXX52");
        //issuer52a.setAcctno("01111001759234567890");
        issuer52a.setPartyIdentifier("1234-5678");
        //issuer52a.setLocation("WHYHCNHBXXX");


        mt787Creator.setTransactionReferenceNumber("EH Eigert Gmb");//20 16x
        mt787Creator.setRelatedReference("EH Eigert");//12 3!n
        mt787Creator.setIssuer52a(issuer52a);
        mt787Creator.setNumberofAmendment("594");
        mt787Creator.setAmendmentStatus("1234"+ Constans.CRLF+"XJIA");
        mt787Creator.setSendertoReceiverInformation("EH Eigert GmbH\n" + "Hauptstrasse 987\n" + "DE/12345 Mannheim");
        mt787Creator.setFileIdentification("EMAL/Email transfer");
//
        MtResult mtResult = MtCreatorManager.packMT(mt787Creator);
//        MtCreatorManager.packMT(mt769Creator);
    }
}
