rkirtir commented on code in PR #4214:
URL: https://github.com/apache/hive/pull/4214#discussion_r1163919706


##########
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java:
##########
@@ -665,7 +666,18 @@ private String sendAuthMethod(HttpRequestBase method, 
boolean enableAuth, boolea
 
       httpResponse = client.execute(method);
 
-      return EntityUtils.toString(httpResponse.getEntity());
+      if (httpResponse != null) {
+        StatusLine statusLine = httpResponse.getStatusLine();
+        if (statusLine != null) {
+           response = httpResponse.getStatusLine().getReasonPhrase();
+           statusCode = httpResponse.getStatusLine().getStatusCode();
+          if (statusCode == 200) {
+            return EntityUtils.toString(httpResponse.getEntity());
+          }

Review Comment:
   Only HTTP 200 contains response body other than this there is no/empty 
response body. If we do not handle this 
   testManualFailoverUnauthorized() method  fails at   
assertTrue(sendDelete(url1, false).contains("Unauthorized"));
   as it tries to get "Unauthorized" string from response body



-- 
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: [email protected]

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