/**
  * @return void
  */
 public function testBootShouldAddGuzzleLogMiddleware()
 {
     $application = new Application();
     $serviceProvider = new ZedRequestLogServiceProvider();
     $serviceProvider->boot($application);
     $handlerStackContainer = new HandlerStackContainer();
     $this->assertTrue($handlerStackContainer->getHandlerStack()->hasHandler());
 }
 /**
  * @param \Psr\Http\Message\RequestInterface $request
  * @param \Spryker\Shared\ZedRequest\Client\ObjectInterface $requestTransfer
  * @param int|null $timeoutInSeconds
  *
  * @throws \Spryker\Shared\ZedRequest\Client\Exception\InvalidZedResponseException
  *
  * @return \Psr\Http\Message\ResponseInterface
  */
 protected function sendRequest(MessageRequestInterface $request, ObjectInterface $requestTransfer, $timeoutInSeconds = null)
 {
     $handlerStackContainer = new HandlerStackContainer();
     $config = ['timeout' => $timeoutInSeconds ?: static::$timeoutInSeconds, 'connect_timeout' => 1.5, 'handler' => $handlerStackContainer->getHandlerStack()];
     $config = $this->addCookiesToForwardDebugSession($config);
     $client = new Client($config);
     $options = ['json' => $requestTransfer->toArray()];
     $response = $client->send($request, $options);
     if (!$response || $response->getStatusCode() !== 200 || !$response->getBody()->getSize()) {
         throw new InvalidZedResponseException('Invalid or empty response', $response, $request->getUri());
     }
     return $response;
 }