/**
  * @test
  * @covers ::findById
  */
 public function it_should_reconstitute_state_based_on_events()
 {
     $event = new Event('test', 1, []);
     $entryWithEvent = new EntryWithEvent(new Entry([]), $event);
     $expectedEntity = new \stdClass();
     $this->streamNameGenerator->shouldReceive('generate')->andReturn('stream.id');
     $this->eventStore->shouldReceive('forwardStreamFeedIterator')->andReturn([$entryWithEvent]);
     $this->eventSerializer->shouldReceive('unserialize')->with('test', [])->once()->andReturn($expectedEntity);
     $this->assertEquals(new AggregateMock(), $this->repository->findById('1'));
 }