+ Start a Discussion
Mike Lee PCLMike Lee PCL 

Apex test fails due to process builder record creation step


I have a problem with a test class where the setting up of data to prepare for the test causes a Process Builder to fire (creates a new record in CustObjA) and causes the Trigger I want to test to fire as well (Trigger on CustObjA). 

The problem is when I perform an insert of a record of CustObjA a little lower in the test class the Trigger does not run a second time. 

Essentially the Process Builder created a record in CustObjA and I'm no longer able to test my Insert Trigger because I can't get it to fire again.

Unfortunatley the record created in the Process Builder isn't usuable for my tests so I need to create a second one tailored to my needs.

Anyone else encounter this sort of issue?