MuleEvent event = RequestContext.setEvent(getTestEvent("payload", endpoint));
Serializable serialized = (Serializable) new SerializableToByteArray().transform(event);
assertNotNull(serialized);
ByteArrayToObject trans = new ByteArrayToObject();
trans.setMuleContext(muleContext);
MuleEvent deserialized = (MuleEvent) trans.transform(serialized);
// Assert that deserialized event is not null and has muleContext
assertNotNull(deserialized);
assertNotNull(deserialized.getMuleContext());