public HttpResponse doRequest(HttpRequestBase request, String username, String password) {
    HttpClientBuilder clientBuilder = HttpClients.custom();
    HttpClientContext clientContext = HttpClientContext.create();

    // configures the clientBuilder and clientContext
    if (username != null) {
      CredentialsProvider credsProvider = new BasicCredentialsProvider();
      credsProvider.setCredentials(new AuthScope(bindAddress, restPort),
          new UsernamePasswordCredentials(username, password));
      clientBuilder.setDefaultCredentialsProvider(credsProvider);
    }

    try {
      if (useSsl) {
        SSLContext ctx = SSLContext.getInstance("TLS");
        ctx.init(new KeyManager[0], new TrustManager[] {new DefaultTrustManager()},
            new SecureRandom());
        clientBuilder.setSSLContext(ctx);
        clientBuilder.setSSLHostnameVerifier(new NoopHostnameVerifier());
      }

      return clientBuilder.build().execute(host, request, clientContext);
    } catch (Exception e) {
      throw new RuntimeException(
          String.format("Request %s' with username '%s' password '%s' failed", request, username,
              password),
          e);
    }
  }
this doesn't need to be a rule, since there is no setup and cleanup to do, just a utility
to issue rest call. It's different from GeodeHttpClientRule in that it creates a httpClient
in every rest call, while GeodeHttpClientRule uses one httpClient for the duration of the
entire test.
geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/test/junit/rules/GeodeDevRestClient.java