I am trying to update the code of a Contact Trigger handler using the Force.com IDE. However, deploying does not work because of an error in an unchanged 3rd-party class.
Even if I uncomment all changes I get the following error on deployment in the Force.com IDE:
Test Results:
Run Failures: TelemarketingControllerTest.testNormalFlow System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TargetX_Email.CampaignTrigger1: execution of AfterInsert
caused by: TargetX_Email.SecurityCheck.CRUDException: User does not have access to update Campaign
Class.TargetX_Email.SecurityCheck.crudError: line 73, column 1 Class.TargetX_Email.SecurityCheck.checkCRUD: line 60, column 1 Class.TargetX_Email.SecurityCheck.checkCRUD: line 43, column 1 Class.TargetX_Email.SecurityCheck.checkBoth: line 20, column 1 Class.TargetX_Email.SecurityCheck: line 10, column 1 Class.TargetX_Email.deleteFutureChildBroadcasts: line 99, column 1 Trigger.TargetX_Email.CampaignTrigger1: line 21, column 1: []
Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required.
Somehow the test is triggering their code, it looks like.
And this is the offending line 31
@isTest
private class TelemarketingControllerTest {
static testMethod void testNormalFlow(){
//campaign
Campaign testCampaign = new Campaign();
testCampaign.name = 'TestCampaign';
testCampaign.CallerTimeout__c = 'Null';
testCampaign.Callbacks__c = '2 Callbacks';
insert testCampaign; // << Line 31
I see the warning about the code coverage. But I guess the real problem is "User does not have access to update Campaign
"
What can I do to avoid the problem and be able to deploy some changes to my Contact Trigger handler?