stoty commented on code in PR #6601:
URL: https://github.com/apache/hbase/pull/6601#discussion_r1938804168


##########
hbase-client/src/test/java/org/apache/hadoop/hbase/security/TestSaslUtil.java:
##########
@@ -61,4 +62,118 @@ public void testInitSaslProperties() {
     props = SaslUtil.initSaslProperties("");
     assertEquals("auth", props.get(Sasl.QOP));
   }
+
+  @Test
+  public void testVerifyQop() {
+    String nullQop = null;
+    String authentication = "auth";
+    String integrity = "auth-int";
+    String confidentality = "auth-conf";
+    String anyQop = "auth-conf,auth-int,auth";
+
+    // Empty requested, got empty
+    try {
+      SaslUtil.verifyNegotiatedQop(nullQop, nullQop);
+    } catch (Exception e) {
+      fail("Should not have thrown exception");

Review Comment:
   Done.



##########
hbase-client/src/test/java/org/apache/hadoop/hbase/security/TestSaslUtil.java:
##########
@@ -61,4 +62,118 @@ public void testInitSaslProperties() {
     props = SaslUtil.initSaslProperties("");
     assertEquals("auth", props.get(Sasl.QOP));
   }
+
+  @Test
+  public void testVerifyQop() {
+    String nullQop = null;
+    String authentication = "auth";
+    String integrity = "auth-int";
+    String confidentality = "auth-conf";
+    String anyQop = "auth-conf,auth-int,auth";
+
+    // Empty requested, got empty
+    try {
+      SaslUtil.verifyNegotiatedQop(nullQop, nullQop);
+    } catch (Exception e) {
+      fail("Should not have thrown exception");
+    }
+
+    // Auth requested, got null
+    try {
+      SaslUtil.verifyNegotiatedQop(authentication, nullQop);
+    } catch (Exception e) {
+      fail("Should not have thrown exception");
+    }
+
+    // Auth requested, got auth
+    try {
+      SaslUtil.verifyNegotiatedQop(authentication, authentication);
+    } catch (Exception e) {
+      fail("Should not have thrown exception");
+    }
+
+    // Auth requested, got confidentality.
+    try {
+      SaslUtil.verifyNegotiatedQop(authentication, confidentality);
+      fail("Should have thrown exception");

Review Comment:
   Done.



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

Reply via email to