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->isOk());
     $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->isOk());
     $this->assertTrue($deleteResponse->acknowledged());
     try {
         $getWarmerRequest = new GetWarmerRequest(ES_INDEX, null, $this->getSerializer());
         $getWarmerRequest->setWarmerName($warmerName);
         $this->getClient()->send($getWarmerRequest);
     } catch (ClientException $exception) {
         $this->assertSame(404, $exception->getCode());
         return;
     }
     $this->fail();
 }
 public function testGetSetWarmerName()
 {
     $warmerName = 'test-warmer-name';
     $this->assertNull($this->request->getWarmerName());
     $this->request->setWarmerName($warmerName);
     $this->assertSame($warmerName, $this->request->getWarmerName());
 }