From cd3632de76d639022b6c43a2aee0af94bdd86744 Mon Sep 17 00:00:00 2001 From: RanadheerRG Date: Fri, 27 Sep 2024 11:51:08 -0700 Subject: [PATCH] Removed the Test Group and added the General_Queue --- .../main/default/classes/QueueOwnerSetterTest.cls | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/classes/QueueOwnerSetterTest.cls b/force-app/main/default/classes/QueueOwnerSetterTest.cls index abe325881..379ac6aca 100644 --- a/force-app/main/default/classes/QueueOwnerSetterTest.cls +++ b/force-app/main/default/classes/QueueOwnerSetterTest.cls @@ -3,8 +3,12 @@ public class QueueOwnerSetterTest { @TestSetup static void makeData() { - Group testGroup = new Group(Name='TestGroup', DeveloperName='TestGroup', Type='Queue'); - insert testGroup; + + Group testGroup = [SELECT Id, Name, DeveloperName, Type FROM GROUP WHERE DeveloperName = 'General_Queue' LIMIT 1]; + if(testGroup == NULL){ + testGroup = new Group(Name='General_Queue', DeveloperName='General_Queue', Type='Queue'); + insert testGroup; + } system.runAs(new User(Id=UserInfo.getUserId())) { insert new QueueSobject[] { @@ -20,14 +24,14 @@ public class QueueOwnerSetterTest { insert saCase; List caseQueues = new List(); - caseQueues.add(newCaseQueue(saCase.Id, 'TestGroup')); + caseQueues.add(newCaseQueue(saCase.Id, 'General_Queue')); Test.startTest(); QueueOwnerSetter.setOwner(caseQueues); Test.stopTest(); system.assertEquals( - [select Id from Group where DeveloperName = 'TestGroup'].Id, + [select Id from Group where DeveloperName = 'General_Queue'].Id, [select OwnerId from Case where Id = :saCase.Id].OwnerId ); } @@ -56,4 +60,4 @@ public class QueueOwnerSetterTest { caseQueue.queueName = queueName; return caseQueue; } -} +} \ No newline at end of file