Package com.influxdb.test
Class AbstractMockServerTest
java.lang.Object
com.influxdb.test.AbstractTest
com.influxdb.test.AbstractMockServerTest
- Author:
- Jakub Bednar (bednar@github) (05/10/2018 08:36)
-
Field Summary
Modifier and TypeFieldDescriptionprotected okhttp3.mockwebserver.MockWebServer
protected MockServerExtension
Fields inherited from class com.influxdb.test.AbstractTest
countDownLatch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
after()
protected okhttp3.mockwebserver.MockResponse
createErrorResponse
(String influxError) protected okhttp3.mockwebserver.MockResponse
createErrorResponse
(String influxError, boolean chunked) protected okhttp3.mockwebserver.MockResponse
createErrorResponse
(String influxError, boolean chunked, int responseCode) protected okhttp3.mockwebserver.MockResponse
createErrorResponse
(String influxError, boolean chunked, int responseCode, int bodyDelay) protected okhttp3.mockwebserver.MockResponse
createResponse
(String data) protected okhttp3.mockwebserver.MockResponse
createResponse
(String data, String contentType, boolean chunked) protected okhttp3.mockwebserver.MockResponse
createResponse
(String data, String contentType, boolean chunked, long bodyDelay) protected void
protected String
getRequestBody
(okhttp3.mockwebserver.MockWebServer server) protected String
Start Mock server.protected okhttp3.mockwebserver.RecordedRequest
Methods inherited from class com.influxdb.test.AbstractTest
generateName, getDeclaredField, getInfluxDb2Ip, getInfluxDb2Port, getInfluxDb2Url, getInfluxDbUrl, influxDBQuery, influxDBWrite, prepare, prepareChunkRecords, waitToCallback, waitToCallback, waitToCallback
-
Field Details
-
mockServer
protected okhttp3.mockwebserver.MockWebServer mockServer -
mockServerExtension
-
-
Constructor Details
-
AbstractMockServerTest
public AbstractMockServerTest()
-
-
Method Details
-
startMockServer
Start Mock server.- Returns:
- the mock server URL
-
after
- Throws:
IOException
-
createResponse
-
createResponse
-
createResponse
-
createErrorResponse
@Nonnull protected okhttp3.mockwebserver.MockResponse createErrorResponse(@Nullable String influxError) -
createErrorResponse
@Nonnull protected okhttp3.mockwebserver.MockResponse createErrorResponse(@Nullable String influxError, boolean chunked) -
createErrorResponse
@Nonnull protected okhttp3.mockwebserver.MockResponse createErrorResponse(@Nullable String influxError, boolean chunked, int responseCode) -
createErrorResponse
@Nonnull protected okhttp3.mockwebserver.MockResponse createErrorResponse(@Nullable String influxError, boolean chunked, int responseCode, int bodyDelay) -
enqueuedResponse
protected void enqueuedResponse() -
takeRequest
- Throws:
InterruptedException
-
getRequestBody
-