### Question:
HttpRemoteQueryClient implements RemoteQueryClient { @Override public <K, V> CompletableFuture<QueryResult<K, V>> query(final ServerHostInfo serverInfo, final QueryInfo query, final Queried options) { final String server = serverInfo.hostAndPort(); final String path = queryURLBuilder.buildURL(server, serverInfo.id(), query.storeName()); final String json = JsonQuerySerde.serialize(query, options); Request request = new Request.Builder() .url(path) .addHeader("Accept", mediaType.toString()) .addHeader("Content-type", mediaType.toString()) .post(RequestBody.create(json, mediaType)) .build(); final QueryResultBuilder<K, V> builder = QueryResultBuilder.<K, V>newBuilder() .setServer(server) .setStoreName(query.storeName()) .setStoreType(query.type().prettyName()); final CompletableFuture<QueryResult<K, V>> future = new CompletableFuture<>(); LOG.debug("Forwarding state store query to remote server {}", server); client.newCall(request).enqueue(new AsyncQueryCallback<>(server, future, builder, serdes)); return future; } HttpRemoteQueryClient(final OkHttpClient httpClient,
                                 final QueryURLBuilder queryURLBuilder,
                                 final Serdes<QueryResult> serdes); @Override CompletableFuture<QueryResult<K, V>> query(final ServerHostInfo serverInfo,
                                                             final QueryInfo query,
                                                             final Queried options);  }### Answer:
@Test public void shouldQueryRemoteServerSuccessfully() throws ExecutionException, InterruptedException { QueryInfo query = new QueryInfo( TEST_STORE_NAME, StoreType.KEY_VALUE, StoreOperation.ALL, QueryParams.empty() ); QueryResult<String, String> queryResult = newQueryResult(); server.enqueue(new MockResponse() .setResponseCode(HttpURLConnection.HTTP_OK) .setBody(new String(SERDES.serialize(queryResult))) ); CompletableFuture<QueryResult<Object, Object>> future = client.query(SERVER_INFO, query, Queried.immediately()); QueryResult<Object, Object> response = future.get(); Assertions.assertEquals(queryResult, response); }