FrankChen021 commented on a change in pull request #10980:
URL: https://github.com/apache/druid/pull/10980#discussion_r616595628



##########
File path: 
integration-tests/src/main/java/org/apache/druid/testing/clients/AbstractQueryResourceTestClient.java
##########
@@ -21,67 +21,157 @@
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.jaxrs.smile.SmileMediaTypes;
 import com.google.inject.Inject;
+import org.apache.druid.guice.annotations.Smile;
+import org.apache.druid.java.util.common.IAE;
 import org.apache.druid.java.util.common.ISE;
 import org.apache.druid.java.util.http.client.HttpClient;
 import org.apache.druid.java.util.http.client.Request;
+import 
org.apache.druid.java.util.http.client.response.BytesFullResponseHandler;
+import org.apache.druid.java.util.http.client.response.BytesFullResponseHolder;
 import org.apache.druid.java.util.http.client.response.StatusResponseHandler;
 import org.apache.druid.java.util.http.client.response.StatusResponseHolder;
-import org.apache.druid.testing.IntegrationTestingConfig;
 import org.apache.druid.testing.guice.TestClient;
+import org.jboss.netty.handler.codec.http.HttpHeaders;
 import org.jboss.netty.handler.codec.http.HttpMethod;
 import org.jboss.netty.handler.codec.http.HttpResponseStatus;
 
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Future;
 
 public abstract class AbstractQueryResourceTestClient<QueryType>
 {
-  private final ObjectMapper jsonMapper;
-  private final HttpClient httpClient;
+  private String contentTypeHeader = MediaType.APPLICATION_JSON;
+
+  /**
+   * a 'null' means the Content-Type in response defaults to Content-Type of 
request
+   */
+  private String acceptHeader = null;
+
+  final ObjectMapper jsonMapper;
+  final ObjectMapper smileMapper;
+  final HttpClient httpClient;
   final String routerUrl;
+  final Map<String, EncoderDecoder<QueryType>> encoderDecoderMap;
+
+  protected void setContentTypeHeader(String contentTypeHeader)

Review comment:
       Fixed

##########
File path: 
integration-tests/src/main/java/org/apache/druid/testing/clients/QueryResourceTestClient.java
##########
@@ -50,4 +62,23 @@ public String getBrokerURL()
     );
   }
 
+  /**
+   * clone a new instance of current object with given encoding.
+   * Note: For {@link AbstractQueryResourceTestClient#queryAsync(String, 
Object)} operation, contentType could only be application/json
+   *
+   * @param contentType Content-Type header of request. Cannot be NULL. Both 
application/json and application/x-jackson-smile are allowed
+   * @param accept      Accept header of request. Both application/json and 
application/x-jackson-smile are allowed
+   */
+  public QueryResourceTestClient withEncoding(String contentType, String 
accept)

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to