From a9baff8a4508c1850e650f68831d857b953eace4 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 16 五月 2022 16:59:25 +0800
Subject: [PATCH] 合同批准后拆分,打印pdf带出套装

---
 force-app/main/default/classes/OrderDivisionControllerTest.cls |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/classes/OrderDivisionControllerTest.cls b/force-app/main/default/classes/OrderDivisionControllerTest.cls
index 35ef85d..95d15bc 100644
--- a/force-app/main/default/classes/OrderDivisionControllerTest.cls
+++ b/force-app/main/default/classes/OrderDivisionControllerTest.cls
@@ -1,8 +1,15 @@
 @isTest
 private class OrderDivisionControllerTest {
+    // Update PIPL 20220516 By Chen Yanan Start
+    @TestSetup
+    static void makeData(){
+        TestDataUtility.CreatePIPolicyConfiguration();
+    }
+    // Update PIPL 20220516 By Chen Yanan End
 
-	@isTest static void test_init() {
-		Id pricebookId = Test.getStandardPricebookId();
+    @isTest static void test_init() {
+        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());   // Update PIPL 20220516 By Chen Yanan
+        Id pricebookId = Test.getStandardPricebookId();
 
         Pricebook2 pricebook = new Pricebook2(
             Name = 'BS',
@@ -42,6 +49,7 @@
         Account user = new Account(
             Name = '*',
             FacilityName__c = 'user',
+            OwnerId = UserInfo.getUserId(),
             PostCode__c = '123456',
             RecordTypeId = rectBS[0].Id
         );
@@ -58,6 +66,7 @@
             AccountId = user.Id,
             StageName = 'Phase3',
             CurrencyIsoCode = 'CNY',
+            OwnerId = UserInfo.getUserId(),
             ProductSegment__c = 'BS',
             CloseDate = Date.today(),
             NewInquiryDate__c = Date.today().addDays(-2),
@@ -123,7 +132,8 @@
             EffectiveDate = Date.today(),
             Status = 'Draft',
             Pricebook2Id = pricebook.Id,
-            EndUser__c = contact.Id
+            EndUser__c = contact.Id,
+            EndUserD__c = contact.Id
         );
         insert order;
 
@@ -287,6 +297,7 @@
     }*/
 
     @isTest static void test_init2() {
+        Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock());   // Update PIPL 20220516 By Chen Yanan
         Id pricebookId = Test.getStandardPricebookId();
 
         Pricebook2 pricebook = new Pricebook2(
@@ -398,7 +409,8 @@
             EffectiveDate = Date.today(),
             Status = 'Draft',
             Pricebook2Id = pricebook.Id,
-            EndUser__c = contact.Id
+            EndUser__c = contact.Id,
+            EndUserD__c = contact.Id
         );
         insert order;
 

--
Gitblit v1.9.1