buli
2022-04-08 b6f2c55d21463def425048aba48bed273156e9a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@isTest
public class NewAndEditContactControllerTest {
    @TestSetup
    static void makeData(){
        TestDataUtility.CreatePIPolicyConfiguration();
    }
    static testMethod void NewAndEditContactController() {
        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
        Contact con = TestDataUtility.CreateContacts(1)[0];
 
        Test.startTest();
        ApexPages.StandardController sc =  new ApexPages.StandardController(con);
        NewAndEditContactController qis = new NewAndEditContactController(sc);
 
        String qisJson = '{"AccountId":"0010l00001Q1r4e","OwnerId":"0050l0000061MOe","Department":"","MobilePhone":"***********","Title":"","Phone":"","Salutation":"","LastName":"***","Fax":"","ContactEnglishName__c":"","OtherPhone":"","ManagementCode_Ext__c":"","Email":"*****@company.com","isBatch__c":false,"TechnicalServiceCreated__c":false,"IsNew__c":false,"isServiceCreate__c":false,"Postcode__c":"**********","Address1__c":"**********","Address2__c":"","Address3__c":"","EnglishAddress__c":"","ProductSegmentBS__c":false,"ProductSegmentRVI__c":false,"ProductSegmentIE__c":false,"ProductSegmentNDT__c":false,"ProductSegmentANI__c":false,"StatusD__c":"Draft","ContactStatus__c":"Active","CancelReason__c":"","Remark__c":"","Phone_Encrypted__c":"","OtherPhone_Encrypted__c":"","MobilePhone_Encrypted__c":"64bd0db056d0bfd21fae76cc5dbdf4d1","PhoneD_Encrypted__c":null,"OtherPhoneD_Encrypted__c":null,"MobilePhoneD_Encrypted__c":null,"Email_Encrypted__c":"68fda69bb586ec70073b015fbff6c19420b838c523e79c9737c6fe095fd5cc55","EmailD_Encrypted__c":null,"FaxD_Encrypted__c":null,"Address3D_Encrypted__c":null,"Address1D_Encrypted__c":null,"Address3_Encrypted__c":"","Address2D_Encrypted__c":null,"Address1_Encrypted__c":"2df1bc4bf3800c5e05e3d9f394c3446567d1f05482d2295650b7b50e9e4aa97a92338985c9693f576e1e6df667aaee46","EnglishAddress_Encrypted__c":"","ContactEnglishName_Encrypted__c":"","Title_Encrypted__c":"","TitleD_Encrypted__c":null,"PostcodeD_Encrypted__c":null,"Postcode_Encrypted__c":"ecec26168c09cf090b8b4a95ca524a61","LastName_Encrypted__c":"dcce196c4cfc273a83777852ddd486ab","PhoneD__c":null,"OtherPhoneD__c":null,"MobilePhoneD__c":null,"EmailD__c":null,"FaxD__c":null,"Address3D__c":null,"Address2D__c":null,"Address1D__c":null,"TitleD__c":null,"PostcodeD__c":null,"AWS_Data_Id__c":"962006242048344064"}';
        NewAndEditContactController.saveContact(qisJson,'avgwshDFcxAS',False);
        NewAndEditContactController.saveContact(qisJson,'avgwshDFcxAS',True);
        Test.stopTest();
    }
}