/**
  * @param UserCreatedEvent $event
  */
 public function handleUserCreatedEvent(UserCreatedEvent $event)
 {
     $this->logger->info('Message read model received user event');
     $user = $this->finder->find((string) $event->getUserId());
     if ($user) {
         $user->setName($event->getUsername());
         $user->setPreferredLanguage($event->getPreferredLanguage());
     } else {
         $user = $this->appUserFactory->create($event->getUserId(), $event->getUsername(), $event->getPreferredLanguage());
     }
     $this->finder->save($user);
 }
 private function assertUserWillNotBeCreated()
 {
     $this->applicationUserFactory->shouldReceive('create')->never();
 }