@isTest
private class NFM702ControllerTest {
    @TestSetup
    static void makeData(){
        TestDataUtility.CreatePIPolicyConfiguration('NFM702');
    }
    public Class GeDatas {
        public NFMUtil.Monitoring Monitoring;
        public GeData[] GeData;
    }

    public Class GeData {
        public String DoctorNo;   //人员管理编码
        public String HospitalName;     //医院名称
        public String OfficeName;   //科室名称
        public String DoctorName;    //姓名
        public String TelNo;   //电话
        public String HcpNo;    //HPC编码
        public Boolean IsActive;    //是否有效
        public String UpdateStatus;     //操作类型
    }

    static testMethod void testMethod1(){

        GeDatas GeDatas = new GeDatas();
        GeDatas.Monitoring = new NFMUtil.Monitoring();
        Datetime nowDT = Datetime.now();
        String nowStr = nowDT.format('yyyyMMddHHmm');
        GeDatas.Monitoring.TransmissionDateTime = nowStr;
        GeDatas.Monitoring.Text                 = ''; 
        GeDatas.Monitoring.Tag                  = '';
        GeDatas.Monitoring.Sender               = 'SFDC';
        GeDatas.Monitoring.Receiver             = 'OBPM';
        GeDatas.Monitoring.MessageType          = 'NFM702';

        GeDatas.GeData = new List<GeData>();
        GeData GeData = new GeData();
        GeDatas.GeData.add(GeData);
        GeData.DoctorNo = 'C000033002';
        GeData.HospitalName = '安徽中医药大学第一附属医院';
        GeData.OfficeName = ' 耳鼻喉科';
        GeData.DoctorName = '刘刚';
        GeData.TelNo = '13810000000';
        GeData.HcpNo = '123456';
        GeData.IsActive = true;
        GeData.UpdateStatus = 'U';

        NFMUtil.Monitoring Monitoring   = new NFMUtil.Monitoring();
        Monitoring.Tag                  = GeDatas.Monitoring.Tag;
        Monitoring.Sender               = GeDatas.Monitoring.Sender;
        Monitoring.Receiver             = GeDatas.Monitoring.Receiver;
        Monitoring.MessageType          = GeDatas.Monitoring.MessageType;
        Monitoring.MessageGroupNumber   = GeDatas.Monitoring.MessageGroupNumber;
        Monitoring.NumberOfRecord       = GeDatas.Monitoring.NumberOfRecord;
        Monitoring.TransmissionDateTime = GeDatas.Monitoring.TransmissionDateTime;
        Monitoring.Text = '';
        BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM702', GeDatas.GeData);
        
        List<Contact> conList = TestDataUtility.CreateContacts(3);
        List<String> geList = new List<String>();
        if(conList.size()>0){
            for(Contact con : conList){
                geList.add(con.Id);
            }
        }
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreatePIHelperHttpMock());
        NFM702Controller.callout(rowData.id, geList);
        NFM702Controller.ManualExecute(rowData.id);

    }
}