From 8badb57ea2c82557850ad5b39281c3e8714eb119 Mon Sep 17 00:00:00 2001
From: liuyan <liuyan@prec-tech.com>
Date: 星期四, 24 十一月 2022 10:08:31 +0800
Subject: [PATCH] 科室信息漏传SPO问题
---
force-app/main/default/classes/LeadIntentionControllerTest.cls | 51 +++++++++++++++++++++++++++++----------------------
1 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/force-app/main/default/classes/LeadIntentionControllerTest.cls b/force-app/main/default/classes/LeadIntentionControllerTest.cls
index 640b4ef..54c5a02 100644
--- a/force-app/main/default/classes/LeadIntentionControllerTest.cls
+++ b/force-app/main/default/classes/LeadIntentionControllerTest.cls
@@ -1,8 +1,15 @@
@isTest
private class LeadIntentionControllerTest {
+
+ @testSetup
+ static void setUp(){
+ TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Inquiry_form__c'});
+ }
+
static testMethod void testMethod1() {
- //鍖婚櫌
- List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+ LeadIntentionController.forTest();
+ //鍖婚櫌
+ List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
if (rectHp.size() == 0) {
return;
}
@@ -13,16 +20,16 @@
}
- Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+ Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
- User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', 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);
- insert hpOwner;
- User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
- insert hpOwner2;
+ User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', 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);
+ insert hpOwner;
+ User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+ insert hpOwner2;
- Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+ Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
hp.FSE_GI_Main_Leader__c = hpOwner.Id;
hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
insert hp;
@@ -62,7 +69,7 @@
inquiryform.Family_Name__c ='闈�';
inquiryform.Opportunity_Division__c = '璇环';
inquiryform.Contact_Name__c = contact2.Id;
- inquiryform.Reasons_options__c ='瀹㈡埛涓嶉渶瑕�';
+ inquiryform.Reasons_options__c ='宸茬粡鏈夎浠�';
inquiryform.Phone__c = '13844756322';
inquiryform.Product1__c = '瓒呭0';
inquiryform.Request1__c = '闇�瑕佹姤浠�';
@@ -72,26 +79,26 @@
page.setRedirect(true);
System.Test.setCurrentPage(page);
-
- // LeadIntentionController conTest = new LeadIntentionController(new ApexPages.StandardController(dpt));
- LeadIntentionController conTest = new LeadIntentionController();
- System.Test.startTest();
- conTest.inquiryformId = inquiryform.Id;
+
+ // LeadIntentionController conTest = new LeadIntentionController(new ApexPages.StandardController(dpt));
+ LeadIntentionController conTest = new LeadIntentionController();
+ System.Test.startTest();
+ conTest.inquiryformId = inquiryform.Id;
- conTest.init();
+ conTest.init();
- conTest.searchOpp();
- conTest.sortTable();
- conTest.save();
- conTest.cancel();
+ conTest.searchOpp();
+ conTest.sortTable();
+ conTest.save();
+ conTest.cancel();
// conTest.pclInfos.reasonFlg ='1';
- conTest.saveInquiryOpts();
+ conTest.saveInquiryOpts();
}
//娴嬭瘯 閫夋嫨涓�浜涚瓫閫夋潯浠�
static testMethod void testMethod2() {
- //鍖婚櫌
+ //鍖婚櫌
List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
if (rectHp.size() == 0) {
return;
@@ -152,7 +159,7 @@
inquiryform.Family_Name__c ='闈�';
inquiryform.Opportunity_Division__c = '璇环';
inquiryform.Contact_Name__c = contact2.Id;
- inquiryform.Reasons_options__c ='瀹㈡埛涓嶅瓨鍦�';
+ inquiryform.Reasons_options__c ='宸茬粡鏈夎浠�';
inquiryform.Phone__c = '13844756322';
inquiryform.Product1__c = '瓒呭0';
inquiryform.Request1__c = '闇�瑕佹姤浠�';
--
Gitblit v1.9.1