liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@isTest
private class SearchContactForAgencyOppControllerTest {
    static testMethod void testMethod1() {
        Oly_TriggerHandler.bypass('ContactTriggerHandler');
        TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c');
        Agency_Contact__c con = TestDataUtility.CreateAgencyContacts(1)[0];
        con.AWS_Data_Id__c = 'davdsvgrqcx';
        update con;
        List<SearchContactForAgencyOppController.AwsData> awsList = new List<SearchContactForAgencyOppController.AwsData>();
        SearchContactForAgencyOppController.AwsData aws = new SearchContactForAgencyOppController.AwsData();
        aws.dataId = 'davdsvgrqcx';
        aws.name = 'testAgencyUser';
        aws.sfRecordId = 'Test';
        aws.type = 'Test';
        aws.doctorDivision1 = 'Test';
        awsList.add(aws);
        String awsListJson = JSON.serialize(awsList);
        Oly_TriggerHandler.bypass('UserToContact');
        String url = ApexPages.currentPage().getParameters().put('hosId',con.Agency_Hospital__c);
        Test.startTest();
        SearchContactForAgencyOppController scc = new SearchContactForAgencyOppController();
        SearchContactForAgencyOppController.searchContacts(awsListJson,'testAgencyUser',con.Agency_Hospital__c);
        Test.stopTest();
    }
}