즐겨찾기Parise Ravikiran (Cognizant Technology Solutions) 님이 #Apex에 질문했습니다2023년 1월 25일 오전 6: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일 오전 7: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일 오전 7: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,