@isTest public with sharing class FileBatchDeleteControllerTest { @TestSetup static void makeData(){ List strList= new List(); strList.add('Document'); TestDataUtility.CreatePIPolicyConfigurations(strList); } static testMethod void testMethod1() { Test.startTest(); FileAddress__c file = new FileAddress__c(); PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document'); file.DownloadLink__c =pI.undeleteUrl+'123'+'&fileName='+'Contact'; file.FileName__c ='Contact'; file.ViewLink__c =pI.queryUrl+'123'; file.AWS_File_Key__c = '123'; insert file; List idList = new List(); idList.add(file.Id); FileBatchDeleteController.fileSFDelete(idList); Test.stopTest(); } static testMethod void testMethod2() { Account acc = TestDataUtility.CreateAccounts(1)[0]; Map accMap = new Map(); accMap.put('Account',acc); accMap.put('object','vjdoneqvds'); String mapJson = JSON.serialize(accMap); Test.setMock(HttpCalloutMock.class, new TestDataUtility.BaseHttpMock(mapJson,'OK','200')); FileAddress__c file = new FileAddress__c(); PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document'); file.DownloadLink__c =pI.undeleteUrl+'123'+'&fileName='+'Contact'; file.FileName__c ='Contact'; file.ViewLink__c =pI.queryUrl+'123'; file.AWS_File_Key__c = '123'; insert file; List keyList = new List(); keyList.add(file.AWS_File_Key__c); Test.startTest(); FileBatchDeleteController.fileAWSDelete(keyList); Test.stopTest(); } }