accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #430: #408 - Removed uses of deprecated ClientConfiguration
Date Thu, 19 Apr 2018 21:11:08 GMT
ctubbsii commented on a change in pull request #430:  #408 - Removed uses of deprecated ClientConfiguration
URL: https://github.com/apache/accumulo/pull/430#discussion_r182885060
 
 

 ##########
 File path: core/src/test/java/org/apache/accumulo/core/client/impl/ThriftTransportKeyTest.java
 ##########
 @@ -74,28 +84,14 @@ public void testSslAndSaslErrors() {
   public void testConnectionCaching() throws IOException, InterruptedException {
     UserGroupInformation user1 = UserGroupInformation.createUserForTesting("user1", new String[0]);
     final KerberosToken token = EasyMock.createMock(KerberosToken.class);
-    final ClientConfiguration clientConf = ClientConfiguration.loadDefault();
-    // The primary is the first component of the principal
-    final String primary = "accumulo";
-    clientConf.withSasl(true, primary);
 
     // A first instance of the SASL cnxn params
     SaslConnectionParams saslParams1 = user1
-        .doAs(new PrivilegedExceptionAction<SaslConnectionParams>() {
-          @Override
-          public SaslConnectionParams run() throws Exception {
-            return new SaslConnectionParams(clientConf, token);
-          }
-        });
+        .doAs((PrivilegedExceptionAction<SaslConnectionParams>) () -> createSaslParams(token));
 
     // A second instance of what should be the same SaslConnectionParams
     SaslConnectionParams saslParams2 = user1
-        .doAs(new PrivilegedExceptionAction<SaslConnectionParams>() {
-          @Override
-          public SaslConnectionParams run() throws Exception {
-            return new SaslConnectionParams(clientConf, token);
-          }
-        });
+        .doAs((PrivilegedExceptionAction<SaslConnectionParams>) () -> createSaslParams(token));
 
 Review comment:
   Is the explicit type required in these lambdas? The lambda is better than the anonymous
class, but I'm wondering if it can be simplified even further.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message