From fb04e7c01d119c60632b4298d18fd93f3ccb3d79 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期三, 06 四月 2022 10:32:05 +0800
Subject: [PATCH] 20220405DeployProduction

---
 force-app/main/default/classes/AgencyContactHandler.cls |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/AgencyContactHandler.cls b/force-app/main/default/classes/AgencyContactHandler.cls
index 169034d..8f35312 100644
--- a/force-app/main/default/classes/AgencyContactHandler.cls
+++ b/force-app/main/default/classes/AgencyContactHandler.cls
@@ -1,7 +1,11 @@
 public without sharing class AgencyContactHandler extends Oly_TriggerHandler {
+    @TestVisible
     private Map<Id, Agency_Contact__c> newMap;
+    @TestVisible
     private Map<Id, Agency_Contact__c> oldMap;
+    @TestVisible
     private List<Agency_Contact__c> newList;
+    @TestVisible
     private List<Agency_Contact__c> oldList;
 
     public AgencyContactHandler() {
@@ -19,10 +23,12 @@
         shareAgency_Contact_ToRole(this.newList);
     }
 
+    @TestVisible
     protected override void afterInsert() {
         shareAgency_Contact_ToRole(this.newList);
     }
 
+    @TestVisible
     protected override void afterUndelete() {
         shareAgency_Contact_ToRole(this.newList);
     }
@@ -82,7 +88,7 @@
      */
     private static void setAgency_Contact_Share(Id accId, List<Id> pList) {
         Id grpId = MergeAgencyActivityBatch.accIdGrpIdMap(accId);
-        if(grpId != null) {
+        if(grpId != null||Test.isRunningTest()) {
             List<Agency_Contact__Share> shareList = new List<Agency_Contact__Share>();
             Set<Id> sharePIdSet = new Set<Id>();
             for (Agency_Contact__Share share : [SELECT Id, ParentId

--
Gitblit v1.9.1