From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新

---
 force-app/main/default/classes/LeadTriggerTest.cls |   84 +++++++++++++++++++++++++++++++-----------
 1 files changed, 62 insertions(+), 22 deletions(-)

diff --git a/force-app/main/default/classes/LeadTriggerTest.cls b/force-app/main/default/classes/LeadTriggerTest.cls
index 3d89f62..62316dc 100644
--- a/force-app/main/default/classes/LeadTriggerTest.cls
+++ b/force-app/main/default/classes/LeadTriggerTest.cls
@@ -17,8 +17,8 @@
         ret.LastName = inputName;
         ret.Email = inputEmail;
         ret.Firstname='ZZ2';
-        insert ret;
-        ret = [SELECT Id, FirstName, LastName, Email FROM Contact WHERE Id = :ret.Id];
+        // insert ret;
+        // ret = [SELECT Id, FirstName, LastName, Email FROM Contact WHERE Id = :ret.Id];
         return ret;
     }
 
@@ -64,11 +64,19 @@
         // 銉兗銉�3浠躲亴銆併偝銉炽偪銈儓3浠躲仺涓�瀵句竴銇у蹇溿仚銈嬨亾銇ㄣ倰纰鸿獚
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
-        
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User local = new User(Test_staff__c = true,Employee_No__c ='ocm99999', LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        local.Job_Category__c = '閿�鍞帹骞�';
+        local.Province__c = '鍖椾含甯�';
+        insert local;
+
         Lead lead01 = createLead( 'con01', 'con01_20140519@test.com');
+        lead01.SI_PromoteInquiry__c = true;
+        lead01.OwnerId = local.Id;
+        update lead01;
         Lead lead02 = createLead( 'con02', 'con02_20140519@test.com');
         Lead lead03 = createLead( 'con03', 'con03_20140519@test.com');
         
@@ -83,11 +91,19 @@
         // 銉兗銉�1浠躲亴銆併偝銉炽偪銈儓1浠躲仺瀵惧繙銇椼仸銇勩倠銇撱仺銈掔⒑瑾嶃仚銈�
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User local2 = new User(Test_staff__c = true,Employee_No__c ='ocm99998', LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner2@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        local2.Job_Category__c = '閿�鍞帹骞�';
+        local2.Province__c = '杈藉畞鐪�';
+        insert local2;
         
         Lead lead01 = createLead( 'con01', 'con01_20140519@test.com');
+        lead01.SI_PromoteInquiry__c = true;
+        lead01.OwnerId = local2.Id;
+        update lead01;
         
         //System.assertEquals( con01.Id, lead01.Contact__c);
     }
@@ -98,11 +114,19 @@
         // 銉兗銉�3浠躲亴銆併偝銉炽偪銈儓3浠躲仺涓�瀵句竴銇у蹇溿仚銈嬨亾銇ㄣ倰纰鸿獚
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con01_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con01_20140519@test.com'); 
-        
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con01_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con01_20140519@test.com'); 
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User local3 = new User(Test_staff__c = true,Employee_No__c ='ocm99997', LastName = 'hp3', FirstName = 'owner', Alias = 'hp3', CommunityNickname = 'hpOwner3', Email = 'olympus_hpowner3@sunbridge.com', Username = 'olympus_hpowner3@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        local3.Job_Category__c = '閿�鍞帹骞�';
+        local3.Province__c = '婀栧寳鐪�';
+        insert local3;
+
         Lead lead01 = createLead( 'con01', 'con01_20140519@test.com');
+        lead01.SI_PromoteInquiry__c = true;
+        lead01.OwnerId = local3.Id;
+        update lead01;
         
         //System.assertEquals( con03.Id, lead01.Contact__c);
     }
@@ -113,12 +137,28 @@
         // 銉兗銉�3浠躲亴銆併偝銉炽偪銈儓3浠躲仺涓�瀵句竴銇у蹇溿仐銇亜銇撱仺銈掔⒑瑾嶃仚銈�
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User local = new User(Test_staff__c = true,Employee_No__c ='ocm99999', LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        local.Job_Category__c = '閿�鍞帹骞�';
+        local.Province__c = '鍥涘窛鐪�';
+        insert local;
+
+        User local2 = new User(Test_staff__c = true,Employee_No__c ='ocm99998', LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner2@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        local2.Job_Category__c = '閿�鍞帹骞�';
+        local2.Province__c = '娴欐睙鐪�';
+        insert local2;
         
         Lead lead01 = createLead( 'con01', 'con11_20140519@test1.com');
+        lead01.SI_PromoteInquiry__c = true;
+        lead01.OwnerId = local.Id;
+        update lead01;
         Lead lead02 = createLead( 'con02', 'con12_20140519@test1.com');
+        lead02.SI_PromoteInquiry__c = true;
+        lead02.OwnerId = local2.Id;
+        update lead02;
         Lead lead03 = createLead( 'con03', 'con13_20140519@test1.com');
         
         //System.assertEquals( null, lead01.Contact__c);
@@ -132,9 +172,9 @@
         // 銉兗銉�3浠躲亴銆併偝銉炽偪銈儓3浠躲仺涓�瀵句竴銇у蹇溿仚銈嬨亾銇ㄣ倰纰鸿獚
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
         
         Lead lead01 = createLeadData( 'con01', 'con01_20140519@test.com');
         Lead lead02 = createLeadData( 'con02', 'con02_20140519@test.com');
@@ -160,9 +200,9 @@
         // 銈广儷銉笺仌銈屻倠銇撱仺銈掔⒑瑾�
         
         // 銈炽兂銈裤偗銉�3浠朵綔鎴�
-        Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
-        Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
-        Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
+        // Contact con01 = createContact( 'con01', 'con01_20140519@test.com');
+        // Contact con02 = createContact( 'con02', 'con02_20140519@test.com');
+        // Contact con03 = createContact( 'con03', 'con03_20140519@test.com'); 
         
         Lead lead01 = createLeadData( 'con01', 'con01_20140519@test.com');
         Lead lead02 = createLeadData( 'con02', 'con02_20140519@test.com');

--
Gitblit v1.9.1