I'm facing an interesting scenario. Spring 15 introduced the ability to "moderate" Chatter private messages. Basically, we can now create triggers on the ChatterMessage object. I coded a trigger and works like a charm.
However, we cannot create/INSERT ChatterMessage records from Apex code. This isn't an issue when it comes to implementing the trigger, but you cannot do the test coverage (not even 1% ?) of the trigger.
Thus, the trigger cannot be included on a Managed package. When I try to upload a Beta version of a Managed package, it throws the error:
Upload Failed: One or more Apex triggers lack test coverage.
So my questions are:
- Is there any way to add (at least a 1% of) test coverage for a trigger defined on a non-insertable (and thus non-deletable, non-updatable) object?
- Is there any way I can add a trigger defined on the ChatterMessage record (after insert) to a Managed package, and then upload package?
- How do people deploy a trigger of this sort on a production org?
I'm stuck :-) Ideas? Hacks?
Thanks in advance,