From 3ba0123db48f8bab81ddf0913e1b95280ef545e8 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期四, 31 三月 2022 17:56:53 +0800 Subject: [PATCH] Deploy0331 --- force-app/main/default/classes/CampaignMemberServiceControllerTest.cls | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls b/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls index b307839..c190cf9 100644 --- a/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls +++ b/force-app/main/default/classes/CampaignMemberServiceControllerTest.cls @@ -1,7 +1,11 @@ @isTest private class CampaignMemberServiceControllerTest { - @testSetup static void testSetupMethod() { + @testSetup + static void makeData(){ + TestDataUtility.CreatePIPolicyConfiguration('Contact'); + } + static void testSetupMethod() { RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; @@ -28,7 +32,7 @@ depart2.Department_Class__c = dept[1].Id; depart2.Hospital__c = acc.Id; insert new Account[] {depart1, depart2}; - Test.startTest(); + Contact con = new Contact(); con.LastName = 'lastname2'; con.FirstName = 'firstname2'; @@ -111,11 +115,11 @@ upsert cmList; - Test.stopTest(); + } @isTest static void test_method_one() { - + testSetupMethod(); list<Campaign> camlist = [select id from campaign]; Campaign cam = camlist[0]; PageReference page = new PageReference('/apex/CampaignMemberService?id=' + cam.Id); @@ -148,6 +152,7 @@ } @isTest static void test_method_two() { + testSetupMethod(); list<Campaign> camlist = [select id from campaign]; Campaign cam1 = camlist[0]; RecordType rectCA = [select Id from RecordType where IsActive = true and SobjectType = 'Campaign' -- Gitblit v1.9.1