jduo commented on a change in pull request #7994:
URL: https://github.com/apache/arrow/pull/7994#discussion_r477766787



##########
File path: 
java/flight/flight-core/src/test/java/org/apache/arrow/flight/auth/TestBasicAuth.java
##########
@@ -44,29 +44,38 @@
 import org.junit.Ignore;
 import org.junit.Test;
 
+import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
 
 public class TestBasicAuth {
 
   private static final String USERNAME = "flight";
   private static final String PASSWORD = "woohoo";
-  private static final byte[] VALID_TOKEN = 
"my_token".getBytes(StandardCharsets.UTF_8);
+  private static final String VALID_TOKEN = "my_token";
 
+  private FlightClient.Builder clientBuilder;
   private FlightClient client;
   private FlightServer server;
   private BufferAllocator allocator;
 
   @Test
   public void validAuth() {
-    client.authenticateBasic(USERNAME, PASSWORD);
-    
Assert.assertTrue(ImmutableList.copyOf(client.listFlights(Criteria.ALL)).size() 
== 0);
+    try {
+      client = clientBuilder.callCredentials(new 
BasicAuthCallCredentials(USERNAME, PASSWORD)).build();
+      client.handshake();
+      
Assert.assertTrue(ImmutableList.copyOf(client.listFlights(Criteria.ALL)).size() 
== 0);

Review comment:
       Changed to assertTrue(isEmpty()). But let's focus on the design given 
this is a POC.




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


Reply via email to