You need to sign in to do that
Don't have an account?

Examples of platform event trigger test classes
I've validated a changeset which returned code coverage failure (even though unrelated to the code being deployed) for an event trigger after running default tests. In order to get the desired code deployed, a test class covering the event trigger needs to be created.
I'm not sure how to go about this and would like to see examples of what a test class for an event trigger would look like.
Here's the event trigger I need coverage for:
trigger MYLogEventTrigger on MYLogEvent__e (after insert) {
List<MYLogEvent__e> eventlist = (List<MYLogEvent__e>) trigger.new;
MY_Util.handleNewEvents(eventlist);
}
Hi,
You can take references from the below code.
test class:
Please mark it as the Best Answer if it helps you.
Thank You