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/SearchVistorControllerTest.cls | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/classes/SearchVistorControllerTest.cls b/force-app/main/default/classes/SearchVistorControllerTest.cls
index 10d5f8f..3dd6632 100644
--- a/force-app/main/default/classes/SearchVistorControllerTest.cls
+++ b/force-app/main/default/classes/SearchVistorControllerTest.cls
@@ -42,11 +42,6 @@
*/
@TestSetup
static void makeData(){
- TestDataUtility.CreatePIPolicyConfiguration('Contact');
- }
- private static void init() {
- loginId = UserInfo.getUserId();
-
Profile p = [select id from Profile where id =:System.Label.ProfileId_SystemAdmin];
u3 = new User(Test_staff__c = true);
@@ -99,7 +94,13 @@
u2.ProfileId = p.id;
u2.Job_Category__c = '閿�鍞帹骞�';
u2.Province__c = '鏉变含';
- insert u2;
+ insert u2;
+ }
+ private static void init() {
+ TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'});
+ loginId = UserInfo.getUserId();
+
+
RecordType rtHP = [select id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName =:'HP'];
RecordType rtDepClass = [select id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName =:'Department_Class_ENT']; // 鑰抽蓟鍠夌
@@ -157,9 +158,9 @@
accDepId = accDep.Id;
accDep = [select Name from Account where Id = :accDep.Id];
accDepName = accDep.Name;
-// 鍙栧紩鍏堣铂浠昏�呫伄浣忔墍銈掓暟寮忛爡鐩伀澶夋洿銇偤銆佸綋瑭查爡鐩倰鍓婇櫎
-// 鐪併伄鍙傜収鍏堛伅鐥呴櫌銇綇鎵�銇仾銇c仧銇熴倎銆併偒銉愩儸銉冦偢銉嗐偣銉堛倰琛屻亞銇伅
-// 鎵�灞炪仚銈嬬梾闄€伄璩炪倰澶夋洿銇椼仸瀹熸柦銇椼仸銇忋仩銇曘亜銆俠y 瀹楀儚(鐪�)
+ // 鍙栧紩鍏堣铂浠昏�呫伄浣忔墍銈掓暟寮忛爡鐩伀澶夋洿銇偤銆佸綋瑭查爡鐩倰鍓婇櫎
+ // 鐪併伄鍙傜収鍏堛伅鐥呴櫌銇綇鎵�銇仾銇c仧銇熴倎銆併偒銉愩儸銉冦偢銉嗐偣銉堛倰琛屻亞銇伅
+ // 鎵�灞炪仚銈嬬梾闄€伄璩炪倰澶夋洿銇椼仸瀹熸柦銇椼仸銇忋仩銇曘亜銆俠y 瀹楀儚(鐪�)
List<Contact> conList = new List<Contact>();
con1 = new Contact();
con1.LastName = '鍙栧紩鍏堣铂浠昏��1';
@@ -167,7 +168,7 @@
con1.RecordTypeId = rtDoc.id;
con1.AccountId = accDep.id;
con1.AWS_Data_Id__c = '1231';
-// con1.State__c = '鍖椾含甯�';
+ //con1.State__c = '鍖椾含甯�';
con2 = new Contact();
con2.FirstName = 'zz2';
con2.LastName = '鍙栧紩鍏堣铂浠昏��2';
@@ -290,4 +291,11 @@
svc.serContact();
}
}
+
+ static testMethod void test01_04() {
+ Test.startTest();
+ Contact con = TestDataUtility.CreateContacts(1)[0];
+ SearchVisitorController.searchContactByAccountId(con.AccountId);
+ Test.stopTest();
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1