FrozenHttpAdapter { public Single<RpcReply<T>> sendRequest( String destination, T request, HttpRequestMethod requestMethod) { return delegate.sendRequest(destination, request, requestMethod, freezeType); } FrozenHttpAdapter(HttpAdapter delegate, Class<T> freezeType); void shutdown(); Single<RpcReply<T>> sendGetRequest(String destination); Single<RpcReply<T>> sendGetRequest(String destination, Map<String, String> headers); Single<RpcReply<T>> sendGetRequest(
            String destination,
            Duration timeout); Single<RpcReply<T>> sendGetRequest(
                String destination,
                Map<String, String> headers,
                Duration timeout); Single<RpcReply<T>> sendPostRequest(
                String destination,
                T request); Single<RpcReply<T>> sendPostRequest(
                String destination,
                Map<String, String> headers,
                T request); Single<RpcReply<T>> sendPostRequest(
                String destination,
                T request,
                Duration timeout); Single<RpcReply<T>> sendPostRequest(
                String destination,
                T request,
                Map<String, String> headers,
                Duration timeout); Single<RpcReply<T>> sendPutRequest(
                String destination,
                T request); Single<RpcReply<T>> sendPutRequest(
                String destination,
                Map<String, String> headers,
                T request); Single<RpcReply<T>> sendPutRequest(
                String destination,
                T request,
                Duration timeout); Single<RpcReply<T>> sendPutRequest(
                String destination,
                Map<String, String> headers,
                T request,
                Duration timeout); Single<RpcReply<T>> sendDeleteRequest(
                String destination,
                T request); Single<RpcReply<T>> sendDeleteRequest(
                String destination,
                Map<String, String> headers,
                T request); Single<RpcReply<T>> sendDeleteRequest(
                String destination,
                T request,
                Duration timeout); Single<RpcReply<T>> sendDeleteRequest(
                String destination,
                T request,
                Map<String, String> headers,
                Duration timeout); Single<RpcReply<T>> sendRequest(
                String destination,
                T request,
                HttpRequestMethod requestMethod); Single<RpcReply<T>> sendRequest(
                String destination,
                T request,
                Map<String, String> headers,
                HttpRequestMethod requestMethod); Single<RpcReply<T>> sendRequest(
                String destination,
                T request,
                HttpRequestMethod requestMethod,
                Duration timeout); Single<RpcReply<T>> sendRequest(
                String destination,
                T request,
                Map<String, String> headers,
                HttpRequestMethod requestMethod,
                Duration timeout);  }
@Test void rpcWorksProperly() throws Exception { Pair<com.sun.net.httpserver.HttpServer, Integer> serverPortPair = httpServer("/rpcTest", "rpcResponse"); TestObserver<RpcReply<String>> observer = sut .sendRequest("http: .test(); await().atMost(40, SECONDS).until(observer::valueCount, is(1)); observer.assertComplete(); observer.assertValue(reply -> "rpcResponse".equals(reply.result)); }