bbende commented on a change in pull request #5277:
URL: https://github.com/apache/nifi/pull/5277#discussion_r691263263



##########
File path: 
nifi-commons/nifi-security-kerberos/src/test/java/org/apache/nifi/security/krb/TestKerberosTicketCacheUser.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.security.krb;
+
+import org.junit.Test;
+
+import javax.security.auth.login.AppConfigurationEntry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+public class TestKerberosTicketCacheUser {
+
+    @Test
+    public void testGetConfigurationEntry() {
+        final String principal = "[email protected]";
+
+        final KerberosUser kerberosUser = new 
KerberosTicketCacheUser(principal);
+        assertEquals(principal, kerberosUser.getPrincipal());
+
+        final AppConfigurationEntry entry = 
kerberosUser.getConfigurationEntry();
+        assertNotNull(entry);
+        assertEquals(ConfigurationUtil.SUN_KRB5_LOGIN_MODULE, 
entry.getLoginModuleName());
+        assertEquals(AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, 
entry.getControlFlag());
+        assertEquals(principal, entry.getOptions().get("principal"));
+        assertEquals("true", entry.getOptions().get("useTicketCache"));
+        assertNull(entry.getOptions().get("ticketCache"));
+    }
+
+    @Test
+    public void testGetConfigurationEntryWithSpecificTicketCache() {
+        final String principal = "[email protected]";
+        final String ticketCache = "/tmp/cache";

Review comment:
       It is just a placeholder, the test is just confirming that the produced 
Configuration has the correct values that were provided, but nothing is being 
done with it.




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