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

        Test.startTest();
        ApexPages.StandardController con =  new ApexPages.StandardController(campM);
        NewAndEditCampaignMemberController campMTest = new NewAndEditCampaignMemberController(con);
        Map<String,Object> mapTest = new Map<String,Object>();
        mapTest.put('Contacts__c',campM );
        //'{"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"}';
        // String campMJson = JSON.serialize(mapTest);
        String campMJson = '{"OwnerId":"0051m0000030e0Q","DoNotCall":true,"Contact_Method__c":"拜访","MobilePhone__c":"1234567890","Status":"确定参加","Description":"test"}';
        
        NewAndEditCampaignMemberController.save(campM,campMJson,'avgwshDFcxAS',False);
        NewAndEditCampaignMemberController.saveCampaignMember(campMJson,'avgwshDFcxAS',False);
        Test.stopTest();
    }
}