@isTest private class CampaignBTPDFControllerTest { @isTest static void testPDF() { RecordType rectCam = [select Id from RecordType where IsActive = true and SobjectType = 'Campaign' and DeveloperName = 'ServiceEngineerTraining']; Campaign cam = new Campaign(); cam.Name = 'cam'; cam.Name2__c = '1234'; cam.RecordTypeId = rectCam.Id; cam.StartDate = Date.today().addDays(-15); cam.EndDate = Date.today().addDays(18); cam.Mailflg_after45__c = true; cam.Mailflg_cancel__c = true; cam.Mailflg_before15__c = true; cam.Mailflg_before7__c = true; cam.Mailflg_after3__c = true; cam.BusinessPurpose__c = '10000000000