@isTest
|
public with sharing class FileBatchDeleteControllerTest {
|
@TestSetup
|
static void makeData(){
|
List<String> strList= new List<String>();
|
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<String> idList = new List<String>();
|
idList.add(file.Id);
|
FileBatchDeleteController.fileSFDelete(idList);
|
Test.stopTest();
|
}
|
|
static testMethod void testMethod2() {
|
Account acc = TestDataUtility.CreateAccounts(1)[0];
|
Map<String,Object> accMap = new Map<String,Object>();
|
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<String> keyList = new List<String>();
|
keyList.add(file.AWS_File_Key__c);
|
Test.startTest();
|
FileBatchDeleteController.fileAWSDelete(keyList);
|
Test.stopTest();
|
}
|
}
|