epugh commented on code in PR #1158:
URL: https://github.com/apache/solr/pull/1158#discussion_r1014385111


##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java:
##########
@@ -542,7 +557,32 @@ public void testUpdate() throws Exception {
   }
 
   @Test
-  public void testRedirect() throws Exception {
+  public void testFollowRedirect() throws Exception {
+    final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo";
+    try (Http2SolrClient client =
+        new 
Http2SolrClient.Builder(clientUrl).withFollowRedirects(true).build()) {
+      SolrQuery q = new SolrQuery("*:*");
+      client.query(q);
+    }
+  }
+
+  @Test
+  public void testDoNotFollowRedirect() throws Exception {
+    final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo";
+    try (Http2SolrClient client =
+        new 
Http2SolrClient.Builder(clientUrl).withFollowRedirects(false).build()) {
+      SolrQuery q = new SolrQuery("*:*");
+      try {
+        client.query(q);
+        fail("Should have thrown an exception.");

Review Comment:
   Done!



##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java:
##########
@@ -518,10 +527,16 @@ public void testUpdate() throws Exception {
       assertEquals("application/xml; charset=UTF-8", 
DebugServlet.headers.get("content-type"));
       assertEquals(1, DebugServlet.parameters.get("a").length);
       assertEquals("\u1234", DebugServlet.parameters.get("a")[0]);
+    }
+    try (Http2SolrClient client =
+        new Http2SolrClient.Builder(url)
+            .withRequestWriter(new BinaryRequestWriter())
+            .withResponseParser(new BinaryResponseParser())
+            .build()) {
 
       // javabin request
-      client.setParser(new BinaryResponseParser());
-      client.setRequestWriter(new BinaryRequestWriter());
+      // client.setParser(new BinaryResponseParser());
+      // client.setRequestWriter(new BinaryRequestWriter());

Review Comment:
   Done!



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to