function it_should_create_via_dataSource(DataSourceInterface $dataSource)
 {
     $data = ['name' => 'foo'];
     $request = Request::create('/user', 'POST');
     $request->attributes->set(AuthorizationListener::API_REQUEST_PAYLOAD, $data);
     $dataSource->create($data)->willReturn(array_merge($data, ['id' => 1]));
     $result = $this->execute($request, $dataSource, 1);
     $result->shouldHaveType('Im0rtality\\ApiBundle\\Actions\\ActionResult');
     $result->getStatusCode()->shouldBe(201);
     $result->getResult()->shouldBe(array_merge($data, ['id' => 1]));
     $result->getType()->shouldBe(ActionResult::INSTANCE);
 }
 /**
  * @inheritdoc
  */
 public function execute(Request $request, DataSourceInterface $resource)
 {
     return ActionResult::instance(201, $resource->create($request->attributes->get(AuthorizationListener::API_REQUEST_PAYLOAD)));
 }