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
mworld2mworld2 

Weirdness in Testing Approval Process Submit/Recall

I have two approval processses set up that are identical except for the object type that they service. I have code that submits files for, and recalls files from, the two approval processes. The APEX is the same for both classes (except for the different object). The test code is the same (except for the different object). Because I trap the MANAGER_NOT_FOUND error in my code, I create two users to run my tests under - one with a designated approver and one without. I use runas for this.

 

When I run my test code, I get the same result regardless of which user I was running under, which is definitely wrong, AND one object always hits the exception and the other never does. This is a double nonsense result.

 

Anyone have experience with this?

 

Mauricio

SatgurSatgur

What did you select as in the APPROVER preferences of Process definition? Was it automatic routing to an approver based on some rules or it is a pre-determined or a User selected approver?

 

If you can share more specifics on the 2 Users and which 2 test conditions you are trying with these 2 sets of users?

 

Also can you post your Test Method code here for more clarity on how you are approaching this test run?

 

Best Regards

Satgur