/*
 * Author: Guo, Aline Yaying
 * Created Date: 03/22/2022
 * Purpose: Test Class
 * History: 
 *      03/22/2022 - Guo, Aline Yaying - Initial Code.
 * 
 * */
@isTest
private class NewAndEditRepairSubOrderControllerTest {
    static testMethod void testMethod1() {
     
        TestDataUtility.CreatePIPolicyConfiguration();
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
        // RepairSubOrder__c subTest = TestDataUtility.CreateRepairSubOrder(1)[0];

        Test.startTest();
        ApexPages.StandardController con =  new ApexPages.StandardController(new RepairSubOrder__c());
        NewAndEditRepairSubOrderController sub = new NewAndEditRepairSubOrderController(con);
        sub.contactsInfo = sub.contactId;
        String subJson = '{"RepairOrderNo__c":"test123","Name":"123","Hospital__c":"0011m00000Xiz4Q","RepairSubOrderType__c":"CIC代填","Department__c":"0011m00000Xiz4Q","Applicanter__c":"0031m00000MtzBhAAJ","Status__c":"待处理","CurrencyIsoCode":"CNY","RepairApplicantName__c":"","ProcessResult__c":"","RepairApplicantTel__c":"","OwnerId":"0051m0000030e0Q","EquipmentCategory__c":"内科系统","AssetType__c":"胃镜","AssetCode__c":"","ProblemDescription__c":"","FaultType__c":"","RepairTime__c":"","ReceiverType__c":"","ReceiverTime__c":"","Receiver__c":"000000000000000","PlannedVisitDay__c":"2022/03/29 12:06","ActualVisitTimeSecond__c":"","ActualVisitTimeThird__c":"","AssetModel__c":"","AirframeCodeEngineer__c":"","RepairApplicantName_Encrypted__c":"","RepairApplicantTel_Encrypted__c":"","AWS_Data_Id__c":"958338146326544385"}';
        NewAndEditRepairSubOrderController.saveRepairSubOrder(subJson,'avgwshDFcxAS',False);
        NewAndEditRepairSubOrderController.saveRepairSubOrder(subJson,'avgwshDFcxAS',True);
        Test.stopTest();
    }
}