ayushtkn commented on a change in pull request #1699: HDFS-14962. RBF: 
ConnectionPool#newConnection() error log wrong protocol class
URL: https://github.com/apache/hadoop/pull/1699#discussion_r344055699
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestConnectionManager.java
 ##########
 @@ -301,4 +301,16 @@ public void testConfigureConnectionActiveRatio() throws 
IOException {
 
     tmpConnManager.close();
   }
+
+  @Test
+  public void testUnsupportedProtoExceptionMsg() throws IOException {
+    exceptionRule.expect(IllegalStateException.class);
+    exceptionRule
+        .expectMessage("Unsupported protocol for connection to NameNode: "
+            + UnsupportedProto.class.getName());
+    ConnectionPool.newConnection(conf, TEST_NN_ADDRESS, TEST_USER1,
+        UnsupportedProto.class);
+  }
+
+  interface UnsupportedProto { }
 
 Review comment:
   Instead Can you LambdaTestUtils, Like this :
   ` @Test
     public void testUnsupportedProtoExceptionMsg() throws Exception {
       LambdaTestUtils.intercept(IllegalStateException.class,
           "Unsupported protocol for connection to NameNode: "
               + TestConnectionManager.class.getName(),
           () -> ConnectionPool.newConnection(conf, TEST_NN_ADDRESS, TEST_USER1,
               TestConnectionManager.class));
     }`

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


With regards,
Apache Git Services

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

Reply via email to