public function testSetGetBody()
 {
     $body = 'my test body';
     $this->serializer->expects($this->once())->method('serialize')->with($this->equalTo($body), $this->equalTo(array()))->will($this->returnValue($body));
     $this->request->setBody($body);
     $this->assertSame($body, $this->request->getBody());
 }
 public function testCreateDeleteWarmer()
 {
     $this->createIndex();
     $this->refreshIndex();
     $warmerName = 'test_warmer';
     $warmer = ['query' => ['match_all' => []]];
     $createWarmerRequest = new CreateWarmerRequest(ES_INDEX, null, $this->getSerializer());
     $createWarmerRequest->setWarmerName($warmerName);
     $createWarmerRequest->setBody($warmer);
     /** @var IndexResponse $createResponse */
     $createResponse = $this->getClient()->send($createWarmerRequest);
     $this->assertTrue($createResponse->acknowledged());
     $this->refreshIndex();
     $getWarmerRequest = new GetWarmerRequest(ES_INDEX, null, $this->getSerializer());
     $getWarmerRequest->setWarmerName($warmerName);
     $getResponse = $this->getClient()->send($getWarmerRequest);
     $data = $getResponse->getData()->getGatewayValue();
     $this->assertArrayHasKey($warmerName, $data[ES_INDEX]['warmers']);
     $deleteRequest = new DeleteWarmerRequest(ES_INDEX, null, $this->getSerializer());
     $deleteRequest->setWarmerName($warmerName);
     /** @var IndexResponse $deleteResponse */
     $deleteResponse = $this->getClient()->send($deleteRequest);
     $this->assertTrue($deleteResponse->acknowledged());
     $getWarmerRequest = new GetWarmerRequest(ES_INDEX, null, $this->getSerializer());
     $getWarmerRequest->setWarmerName($warmerName);
     $getResponse = $this->getClient()->send($getWarmerRequest);
     $this->assertEmpty($getResponse->getData()->getGatewayValue());
 }