public function withUser()
 {
     $user = $this->entity->getUser();
     if ($user !== null) {
         $this->entityDTO->user = $this->dtoBuilderFactory->getUserDTOBuilder($user)->build();
     }
     return $this;
 }
 public function testCreateDefaults()
 {
     $this->assertEntityValid($this->userToken);
     $this->assertTrue($this->userToken->getId() instanceof UuidInterface);
     $this->assertTrue($this->userToken->getCreated() instanceof DateTime);
     $this->assertSame(self::USER_AGENT, $this->userToken->getUserAgent());
     $this->assertFalse($this->userToken->verifyToken('wrong-token'));
     $this->assertTrue($this->userToken->verifyToken(self::TOKEN));
     $this->assertEntitiesEqual($this->user, $this->userToken->getUser());
     $this->assertEquals($this->expires, $this->userToken->getExpires());
     $this->assertTrue($this->userToken->getType()->isInternal());
 }