public function testCanCreateSerializationContextHandler()
 {
     $methodModel = Mockery::mock(MethodModel::class);
     $methodBodyBuilder = Mockery::mock(MethodBodyBuilder::class);
     $annotationCollection = Mockery::mock(AnnotationCollection::class);
     $handlerFactory = new HandlerFactory();
     $handler = $handlerFactory->serializationContext($methodModel, $methodBodyBuilder, $annotationCollection);
     $this->assertInstanceOf(SerializationContextHandler::class, $handler);
 }
 /**
  * Handler the event
  *
  * @param MethodEvent $event
  */
 public function __invoke(MethodEvent $event)
 {
     $methodModel = $event->getMethodModel();
     $annotations = $event->getAnnotationCollection();
     $methodBodyBuilder = $this->methodBodyBuilderFactory->make();
     $handlers = [$this->handlerFactory->baseUrl($methodModel, $methodBodyBuilder, $annotations), $this->handlerFactory->serializationContext($methodModel, $methodBodyBuilder, $annotations), $this->handlerFactory->requestUrl($methodModel, $methodBodyBuilder, $annotations), $this->handlerFactory->requestHeader($methodModel, $methodBodyBuilder, $annotations), $this->handlerFactory->requestBody($methodModel, $methodBodyBuilder, $annotations), $this->handlerFactory->returns($methodModel, $methodBodyBuilder, $annotations)];
     /** @var Handler $handler */
     foreach ($handlers as $handler) {
         $handler->handle();
     }
     $body = $methodBodyBuilder->build();
     $methodModel->setBody($body);
 }