Skip to content

add main test#8

Open
effordDev wants to merge 1 commit intoalexed1:masterfrom
effordDev:master
Open

add main test#8
effordDev wants to merge 1 commit intoalexed1:masterfrom
effordDev:master

Conversation

@effordDev
Copy link
Copy Markdown

Added better starting code for GetProcessInstanceDataTest.cls. User's will need to update record creation in the test for whatever objects have a valid approval process.

@alexed1
Copy link
Copy Markdown
Owner

alexed1 commented Oct 29, 2022

Thanks for the contribution! Can you elaborate on the changes? What instructions would we now have to give the user in order to get the test to pass?

@TestSetup
private static void makeData(){
//insert a record that has an approval process on the targeted object
Account account = new Account();
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert the record of the type sObject that has an active approval we can submit to.

@isTest
private static void getProcessInstanceDataMainTest() {
//query that record
Account sob = [
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query the record we inserted from the makeData() method.



//query the user / queue that the record will be assigned to once submitted for approval - this will be your ActorId
Group queue = [
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query the Queue or User that is assigned the first step in the approval process. For Example - The 'Processor_Assignor' queue gets assigned the first approval step in the process.

image

@effordDev
Copy link
Copy Markdown
Author

effordDev commented Oct 31, 2022

Hi @alexed1 , I added line comments in the files changed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants