function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
marcobmarcob 

test fails dus to missing approval process definition in patch org

Hi,

 

when running a test class in a patch org, i get errors due to the fact that i haven't set up an approval process definition. Since this is a patch org, i don't want to have to set up a process definition every time we open up a new patch org.

 

Any suggestions how to deal with this? I know we can't create a process definition in apex, that would have been simple..

 

Thx in advance!

Marco

 

Best Answer chosen by Admin (Salesforce Developers) 
Starz26Starz26

You could do a check in the test method for Org ID and skip that part if not your production org but your coverage will suffer

 

Otherwise if you are looking for an approval process is must be there

All Answers

Starz26Starz26

You could do a check in the test method for Org ID and skip that part if not your production org but your coverage will suffer

 

Otherwise if you are looking for an approval process is must be there

This was selected as the best answer
marcobmarcob

thanks for your respons, i think there is no other way than to create a process manually in every new patch org. I don't want to use hard coded org id's, but thanks for the suggestion anyway!