0

When running testMethods which test logic I've built to interact with a managed package, it seems the triggers in the managed package are not firing, therefore I cannot test if my trigger is interacting with the managed package correctly...

Is this true? Any ways around it?

  • This is not what i would call normal behaviour no, can you elaborate on what your doing and what gives you this impression? – Andrew Fawcett Mar 29 '14 at 8:52
  • During my implementation of a CPQ tool, I found I needed to flip a checkbox off/on on the contract when a co-termed opportunity was won (this off/on would refresh/sync the renewal opportunity out in the future). I wrote a trigger to facilitate this. During unit testing, when I create a quote and quote lines from an opportunity, the CPQ module is supposed to copy those quotes lines to become opportunity products, and this is not happening at all (even many steps later, so order of execution isn't an issue). Perhaps @user2446975 is correct in that they turn off their triggers during tests. – Nathan Williams Mar 29 '14 at 15:30
  • 1
    Yes perhaps this may be the explanation, it seems an odd practice since they themselves would not get coverage in their own tests needed to gain coverage for packaging. Have you considered contacting the vendor? – Andrew Fawcett Mar 31 '14 at 9:09
  • In the process of contacting them. Wasn't sure if this was expected behavior or not (couldn't figure out why it would be, but worth an ask...) – Nathan Williams Mar 31 '14 at 14:15
2

I think that all triggers are executed [The order of execution isn’t guaranteed when having multiple triggers for the same object due to the same event.] Your trigger can executed before trigger from managed package.

The other possibility is that this particular managed package has some additional code for disabling this trigger in managed package during yours unit tests - for example using static resources - look at slide 21.

Probably you should look into debug log.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.