收藏Parise Ravikiran (Cognizant Technology Solutions) 提问于 #Apex2023年1月25日 06:03System.AssertException: Assertion Failed: Expected: Consented, Actual: null Class.LeadTriggerUtilityTest.duplicateLeadOptInInsertEloquaUser: line 1390, column 1 @isTest static void duplicateLeadOptInInsertEloquaUser() { User elqIntUser = [Select Id from User where username = :Label.Eloqua_Integration_User_Name limit 1]; Test.startTest(); System.runAs(elqIntUser) { Lead sfdcLead2 = CreateLead('John', 'duplicateLeadOptInInsertEloquauser', notOptInOrOut, 'Docusign', 'United States'); sfdcLead2.HasOptedOutOfEmail = false; sfdcLead2.Hard_Opt_In__c = true; LeadTriggerControl.executeAfterUpdate = true; Database.DMLOptions dml2 = new Database.DMLOptions(); dml2.DuplicateRuleHeader.AllowSave = true; Database.SaveResult sr2 = Database.insert(sfdcLead2, dml2); Lead l1 = GetLeadById(sfdcLead2.Id); System.assertEquals(false, l1.Outreach_Opt_Out__c); System.assertEquals(LeadToOpportunityUtilityCls.CONSENTED, l1.Email_Consent_Status__c); }5 个回答排序按日期排序按最有帮助排序按日期排序加载更多评论...Sai Praveen Kumar Kakkirala (Salesforce)2023年1月25日 07:25Hi ,Firstly once you execute GetLeadsByEmail method now check what is the value you are getting the field and then use assertequals based on the value.Same with GetContactsByEmail as well.Thanks, 添加评论撰写回答...粗体斜体下划线删除线项目符号列表编号列表添加链接代码块插入图像附加文件链接 URL取消保存0/9000回复
Sai Praveen Kumar Kakkirala (Salesforce)2023年1月25日 07:25Hi ,Firstly once you execute GetLeadsByEmail method now check what is the value you are getting the field and then use assertequals based on the value.Same with GetContactsByEmail as well.Thanks,