From 29eee328fe8b7baab0f7c68c89a6c92c915dec41 Mon Sep 17 00:00:00 2001 From: javanna Date: Fri, 3 Jun 2016 18:23:52 +0200 Subject: [PATCH] [TEST] expand RequestLoggerTests to all the supported http methods --- .../elasticsearch/client/RequestLoggerTests.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/test/java/org/elasticsearch/client/RequestLoggerTests.java b/client/src/test/java/org/elasticsearch/client/RequestLoggerTests.java index 89fa30c7e08..64bddf88af2 100644 --- a/client/src/test/java/org/elasticsearch/client/RequestLoggerTests.java +++ b/client/src/test/java/org/elasticsearch/client/RequestLoggerTests.java @@ -24,9 +24,12 @@ import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpHost; import org.apache.http.ProtocolVersion; import org.apache.http.client.methods.HttpHead; +import org.apache.http.client.methods.HttpOptions; +import org.apache.http.client.methods.HttpPatch; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.methods.HttpTrace; import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicHttpResponse; import org.apache.http.message.BasicStatusLine; @@ -46,7 +49,7 @@ public class RequestLoggerTests extends LuceneTestCase { URI uri = new URI("/index/type/_api"); HttpRequestBase request; - int requestType = RandomInts.randomIntBetween(random(), 0, 4); + int requestType = RandomInts.randomIntBetween(random(), 0, 7); switch(requestType) { case 0: request = new HttpGetWithEntity(uri); @@ -63,6 +66,15 @@ public class RequestLoggerTests extends LuceneTestCase { case 4: request = new HttpHead(uri); break; + case 5: + request = new HttpTrace(uri); + break; + case 6: + request = new HttpOptions(uri); + break; + case 7: + request = new HttpPatch(uri); + break; default: throw new UnsupportedOperationException(); }