/*
|
* Author: Guo, Aline Yaying
|
* Created Date: 03/22/2022
|
* Purpose: Test Class
|
* History:
|
* 03/22/2022 - Guo, Aline Yaying - Initial Code.
|
*
|
* */
|
@isTest
|
private class NewAndEditAgencyContactControllerTest {
|
@TestSetup
|
static void makeData(){
|
TestDataUtility.CreatePIPolicyConfiguration();
|
}
|
static testMethod void testMethod2() {
|
|
|
Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());
|
Agency_Contact__c agenCon = TestDataUtility.CreateAgencyContacts(1)[0];
|
Contact cont = TestDataUtility.CreateContacts(1)[0];
|
agenCon.Contact__c = cont.Id;
|
update agenCon;
|
Test.startTest();
|
ApexPages.StandardController con = new ApexPages.StandardController(agenCon);
|
try{
|
NewAndEditAgencyContactController agTest = new NewAndEditAgencyContactController(con);
|
System.debug('agTest----'+agTest);
|
String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}';
|
System.debug('ag JSON----'+agenConJson);
|
//NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False);
|
}catch(Exception e){
|
system.debug('Exception from save contact');
|
}
|
Test.stopTest();
|
}
|
|
static testMethod void testMethod2A() {
|
|
String agenConJson = '{"AWS_Data_Id__c":"FDSFSFDDS","Name":"Test","Contact__c":"000000000000000","Type__c":"","Agency_ID__c":"Tst","OwnerId":"0050l000005fcntAAA","Agency_Hospital__c":"000000000000000"}';
|
System.debug('ag JSON----'+agenConJson);
|
NewAndEditAgencyContactController.saveContact(agenConJson,'avgwshDFcxAS',False);
|
}
|
}
|