/**
  * @covers \PhpCqrs\Domain\Event\GenericDomainEventMessage::forPayloadAndMetaData
  */
 public function testCanConstructForPayloadAndMetaData()
 {
     $message = GenericDomainEventMessage::forPayloadAndMetaData('1', 1, new BookPublished('1234'), new MetaData());
     $this->assertInstanceOf(GenericDomainEventMessage::class, $message);
 }
 /**
  * @param Payload  $payload
  * @param MetaData $metaData
  * @return void
  */
 protected function record(Payload $payload, MetaData $metaData)
 {
     $this->apply($payload, $metaData);
     $message = GenericDomainEventMessage::forPayloadAndMetaData($this->id(), $this->next(), $payload, $metaData);
     $this->events[] = $message;
 }