package com.brilliance.isc.convert.mt1xx;

import com.brilliance.isc.swift.objmtconvert.manager.MtCreatorManager;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT198Creator;
import com.brilliance.isc.swift.objmtconvert.model.mt1xx.MT199Creator;
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 Mt199Test {
    @Test
    public void mt199_Test()throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {

        //构造参数传入MT报文类型
//        MT198Creator mt198Creator=new MT198Creator("198");
//        mt198Creator.setSendBic("PSBCCNBJXXX");
//        mt198Creator.setRecvBic("CIPSCNSHXXX");
//        mt198Creator.setTransactionReferenceNumber("TransactionReferenceNumber");
//        mt198Creator.setSubMessageType("123");
//        mt198Creator.setProprietaryMessage("123"+ Constans.NEW_LINE+"456");
        MT199Creator mt199Creator=new MT199Creator("199");
        mt199Creator.setSendBic("PSBCCNBJXXX");
        mt199Creator.setRecvBic("CIPSCNSHXXX");
        mt199Creator.setTransactionReferenceNumber("RelatedReference");
        mt199Creator.setRelatedReference("RelatedReference");
        mt199Creator.setNarrative("NarrativeNarrative"+Constans.CRLF+"RelatedReference");


        // String json = JsonUtil.toJson(map);

        /********以上为json参数**************/

        //MtResult mtResult = MtCreatorManager.packMt(json);
//        MtResult mtResult = MtCreatorManager.pack(mt199Creator);
//        if (mtResult.isSuccess())
//            System.out.println(mtResult.getMessage());
//        else
//            System.out.println(mtResult.getDsp());
        MtCreatorManager.packMT(mt199Creator);
    }
}
