@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 awsList = new List(); 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(); } }