public MockHttpApiRule registerOk(final String pathRegex, final String responseBody) {
    return addRegistration(pathRegex, (target, resp) -> {
      try {
        resp.setStatus(HttpServletResponse.SC_OK);
        resp.setCharacterEncoding("UTF-8");
        resp.setContentType(MediaType.APPLICATION_JSON_TYPE.toString());
        final PrintWriter writer = resp.getWriter();
        writer.write(responseBody);
        writer.flush();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    });
  }
Shortcut method for calling {@link #addRegistration(String, BiConsumer)} with a 200 response.
hbase-it/src/test/java/org/apache/hadoop/hbase/MockHttpApiRule.java