tl;dr The result of an async job enqueued by a platform event trigger cannot be validated in an Apex test
This app demonstrates a limitation of Apex testing for Platform Events,
where Test.stopTest()
does not resolve the async job enqueued
by a platform event trigger.
HelloEventTriggerTest.publishDefaultHello
passes, confirming expected behavior for a synchronous DML operation performed by a platform event triggerAsyncHelloEventTriggerTest.publishDefaultHello
fails, exposing the bug or limitation in Apex tests whereTest.stopTest()
fails to resolve the enqueuedQueueable
job that is supposed to perform a DML operation