@isTest
private class NFM116ControllerTest {
    @TestSetup
    static void makeData(){
        Opportunity opp = new Opportunity();
        opp.Opportunity_No__c = 'XB-153P-06-S151289';
        opp.Opportunity_Category__c = 'ET';
        opp.StageName = '目標';
        opp.Authorized_DB_No__c = 'XB-153P-06-S151289';
        opp.Name = '::XB-153P-06-S151289';
        opp.Close_Forecasted_Date__c = Date.today();
        opp.CloseDate = Date.today();
        opp.Opp_Confirmation_Day__c = Date.today();
        insert opp;
        
        Statu_Achievements__c Statu1 = new Statu_Achievements__c();
        Statu1.ContractNO__c = 'SH-ET-191025';
        Statu1.Opportunity__c = opp.Id;
        Statu1.ContractAmount__c = 100;
        insert Statu1;

        eSignForm__c es = new eSignForm__c();
        es.Statu_Achievements__c = Statu1.Id;
        es.DNName__c = '11223344';
        es.agencyAutoSignUpStatus__c = '已批准';
        es.agencySignUpDate__c = Date.today().addDays(-1);
        es.agencyConfirmDate__c = Date.today().addDays(-1);
        es.HPSignUpStatus__c = '已批准';
        es.HPSignUpDate__c = Date.today().addDays(-1);
        es.HPConfirmDate__c = Date.today().addDays(-1);
        insert es;

        eSignFormLineItem__c esi = new eSignFormLineItem__c();
        esi.Count__c = 2;
        esi.agencyGoodStatus__c = '完好';
        esi.eSignForm__c = es.Id;
        insert esi;
        eSignFormLineItem__c esi2 = new eSignFormLineItem__c();
        esi2.Count__c = 2;
        esi2.agencyGoodStatus__c = '完好';
        esi2.eSignForm__c = es.Id;
        insert esi2;
    }

    static testMethod void testMethod1() {
        List<eSignForm__c> eSignFormList = [select id from eSignForm__c];
        List<String> eSignFormIdList = new List<String>();
        for(eSignForm__c es : eSignFormList){
            eSignFormIdList.add(es.Id);
        }
        BatchIF_Log__c iflog = new BatchIF_Log__c();
        iflog.Log__c = 'test start \n';
        insert iflog;
        Test.startTest();
        NFM116Controller.callout(iflog.Id, eSignFormIdList);
        Test.stopTest();
    }
}