charlesconnell commented on code in PR #6272:
URL: https://github.com/apache/hadoop/pull/6272#discussion_r1393188374
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestSaslPropertiesResolver.java:
##########
@@ -0,0 +1,49 @@
+package org.apache.hadoop.security;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import javax.security.sasl.Sasl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.hadoop.conf.Configuration;
+
+import static
org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_RPC_PROTECTION;
+import static org.junit.Assert.assertEquals;
+
+public class TestSaslPropertiesResolver {
Review Comment:
I'm subclassing it now. I didn't see examples of other test classes
overriding its methods though, and it didn't seem to make sense to do that.
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestSaslPropertiesResolver.java:
##########
@@ -0,0 +1,49 @@
+package org.apache.hadoop.security;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import javax.security.sasl.Sasl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.hadoop.conf.Configuration;
+
+import static
org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_RPC_PROTECTION;
+import static org.junit.Assert.assertEquals;
+
+public class TestSaslPropertiesResolver {
+
+ private static final SaslRpcServer.QualityOfProtection PRIVACY_QOP =
SaslRpcServer.QualityOfProtection.PRIVACY;
+ private static final SaslRpcServer.QualityOfProtection AUTHENTICATION_QOP =
SaslRpcServer.QualityOfProtection.AUTHENTICATION;
+ private static final InetAddress LOCALHOST = new
InetSocketAddress("127.0.0.1", 1).getAddress();
+
+ private SaslPropertiesResolver resolver;
+
+ @Before
+ public void setup() {
+ Configuration conf = new Configuration();
+ conf.set(HADOOP_RPC_PROTECTION, "privacy");
+ resolver = new SaslPropertiesResolver();
+ resolver.setConf(conf);
+ }
+
+ @Test
+ public void testResolverDoesNotMutate() {
+ assertEquals(PRIVACY_QOP.getSaslQop(),
resolver.getDefaultProperties().get(Sasl.QOP));
Review Comment:
Removed a bunch of duplication.
--
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]