Package org.apache.hadoop.hbase
Class MockHttpApiRule
java.lang.Object
org.apache.hadoop.hbase.MockHttpApiRule
A simple http server for testing. The caller registers request handlers to URI path regexp.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MockHttpApiRule.MockHandlerprivate static final org.slf4j.Loggerprivate org.apache.hbase.thirdparty.org.eclipse.jetty.server.Server -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRegistration(String pathRegex, BiConsumer<String, org.apache.hbase.thirdparty.org.eclipse.jetty.server.Response> responder) Register a callback handler for the specified path target.private static org.apache.hbase.thirdparty.org.eclipse.jetty.server.RequestLogvoidvoidclose()getURI()Retrieve the service URI for this service.registerOk(String pathRegex, String responseBody) Shortcut method for callingaddRegistration(String, BiConsumer)with a 200 response.voidstart()
-
Field Details
-
LOG
-
handler
-
server
-
-
Constructor Details
-
MockHttpApiRule
public MockHttpApiRule()
-
-
Method Details
-
addRegistration
public MockHttpApiRule addRegistration(String pathRegex, BiConsumer<String, org.apache.hbase.thirdparty.org.eclipse.jetty.server.Response> responder) Register a callback handler for the specified path target. -
registerOk
Shortcut method for callingaddRegistration(String, BiConsumer)with a 200 response. -
clearRegistrations
-
getURI
Retrieve the service URI for this service. -
start
- Throws:
Exception
-
close
-
buildRequestLog
-