Class ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
java.lang.Object
org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
- All Implemented Interfaces:
HttpHandler
,ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
- Enclosing class:
- ESMockAPIBasedRepositoryIntegTestCase
protected abstract static class ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
extends Object
implements ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
HTTP handler that injects random service errors
Note: it is not a good idea to allow this handler to simulate too many errors as it would
slow down the test suite.
-
Constructor Summary
ModifierConstructorDescriptionprotected
ErroneousHttpHandler
(HttpHandler delegate, int maxErrorsPerRequest) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canFailRequest
(HttpExchange exchange) void
handle
(HttpExchange exchange) protected void
handleAsError
(HttpExchange exchange) protected abstract String
requestUniqueId
(HttpExchange exchange)
-
Constructor Details
-
ErroneousHttpHandler
-
-
Method Details
-
handle
- Specified by:
handle
in interfaceHttpHandler
- Throws:
IOException
-
handleAsError
- Throws:
IOException
-
requestUniqueId
-
canFailRequest
-
getDelegate
- Specified by:
getDelegate
in interfaceESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
-