GWY
2022-05-16 a9baff8a4508c1850e650f68831d857b953eace4
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;