Apache9 commented on a change in pull request #3325:
URL: https://github.com/apache/hbase/pull/3325#discussion_r647162406



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSRpcServices.java
##########
@@ -54,12 +55,16 @@ public void testRegionScannerHolderToString() throws 
UnknownHostException {
     Mockito.when(call.getRemotePort()).thenReturn(port);
     InetAddress address = InetAddress.getLocalHost();
     Mockito.when(call.getRemoteAddress()).thenReturn(address);
+    Optional<String> userName = Optional.ofNullable("test");
+    Mockito.when(call.getRequestUserName()).thenReturn(userName);
     RpcServer.setCurrentCall(call);
     String clientIpAndPort = RSRpcServices.getRemoteClientIpAndPort();
+    String userNameTest = RSRpcServices.getUserName();

Review comment:
       No assertion here?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
##########
@@ -1430,6 +1431,17 @@ static String getRemoteClientIpAndPort() {
     return Address.fromParts(address.getHostAddress(), 
rpcCall.getRemotePort()).toString();
   }
 
+  /**
+   * @return Remote client's username.
+   */
+  static String getUserName() {

Review comment:
       Oh, it is only called inside RSRpcService? So it should be private, but 
for testing, we make it package private. Then please add a RestrictApi 
annotation here.




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