/*
 * Author: Guo, Aline Yaying
 * Created Date: 03/22/2022
 * Purpose: Test Class
 * History: 
 *      03/22/2022 - Guo, Aline Yaying - Initial Code.
 * 
 * */
@isTest
private class NewAndEditASEActivityControllerTest {
    static testMethod void testMethod3() {
     
        TestDataUtility.CreatePIPolicyConfiguration();
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
        ASEActivity__c aA = TestDataUtility.CreateASEActivity(1)[0];
        // aA.AWS_Data_Id__c = '23546542256';
        // update aA;

        Test.startTest();
        ApexPages.StandardController con =  new ApexPages.StandardController(aA);
        NewAndEditASEActivityController aATest = new NewAndEditASEActivityController(con);
        
        // Map<String,Object> mapTest = new Map<String,Object>();
        // mapTest.put('CustomerTel__c',aA );
        // String addressJson = JSON.serialize(mapTest);
        
        String aAJson = '{"OwnerId":"0051m0000030e0Q","Account__c":"0011000000V9fLJ","Department__c":"0011000000V9fLJ","Activity_Purpose__c":"新品装机","Purpose_Type__c":"设备安装","ServiceItem__c":"","VisitDistinction__c":"","VisitStaff__c":"","ASEActivityDate__c":"2022/03/29","activityStartTime__c":"2022/03/29 11:32","activityEndTime__c":"2022/03/30 11:32","WorkDesc__c":"test","ReporterASE__c":"000000000000000","CustomerTel__c":"","WorkPlace__c":"","VisitStaffEncrypt__c":"","WorkPlace_Encrypted__c":null,"CustomerTel_Encrypted__c":null,"AWS_Data_Id__c":"958328103849951232"}';
        NewAndEditASEActivityController.saveASEActivity(aAJson,'avgwshDFcxAS',False);
        Test.stopTest();
    }

    static testMethod void testMethod1() {
     
        TestDataUtility.CreatePIPolicyConfiguration();
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
        Contact contact = TestDataUtility.CreateContacts(1)[0];
        ASEActivity__c aA = new ASEActivity__c();
        aA.ReporterASE__c = contact.id;//客户人员， Contact
        aA.CustomerTel__c = '123123';

        Test.startTest();
        ApexPages.StandardController con =  new ApexPages.StandardController(aA);
        NewAndEditASEActivityController aATest = new NewAndEditASEActivityController(con);
        
        String aAJson = '{"OwnerId":"0051m0000030e0Q","Account__c":"0011000000V9fLJ","Department__c":"0011000000V9fLJ","Activity_Purpose__c":"新品装机","Purpose_Type__c":"设备安装","ServiceItem__c":"","VisitDistinction__c":"","VisitStaff__c":"","ASEActivityDate__c":"2022/03/29","activityStartTime__c":"2022/03/29 11:32","activityEndTime__c":"2022/03/30 11:32","WorkDesc__c":"test","ReporterASE__c":"000000000000000","CustomerTel__c":"","WorkPlace__c":"","VisitStaffEncrypt__c":"","WorkPlace_Encrypted__c":null,"CustomerTel_Encrypted__c":null,"AWS_Data_Id__c":"958328103849951232"}';
        NewAndEditASEActivityController.saveASEActivity(aAJson,'avgwshDFcxAS',False);
        Test.stopTest();
    }
}