Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d804387a8 -> 39b75711b


AMBARI-18406. Create authentication filter to perform Kerberos authentication 
for Ambari [amended] (rlevas)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/39b75711
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/39b75711
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/39b75711

Branch: refs/heads/branch-2.5
Commit: 39b75711bd49bf8c51a01026e65546bd288ab45a
Parents: d804387
Author: Robert Levas <rle...@hortonworks.com>
Authored: Wed Sep 21 13:11:17 2016 -0400
Committer: Robert Levas <rle...@hortonworks.com>
Committed: Wed Sep 21 13:11:17 2016 -0400

----------------------------------------------------------------------
 .../AmbariAuthToLocalUserDetailsServiceTest.java       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/39b75711/ambari-server/src/test/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsServiceTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsServiceTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsServiceTest.java
index 3174af9..41664fd 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsServiceTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authentication/kerberos/AmbariAuthToLocalUserDetailsServiceTest.java
@@ -25,6 +25,7 @@ import org.apache.ambari.server.security.authorization.User;
 import org.apache.ambari.server.security.authorization.UserType;
 import org.apache.ambari.server.security.authorization.Users;
 import org.easymock.EasyMockSupport;
+import org.junit.Before;
 import org.junit.Test;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
@@ -36,6 +37,14 @@ import java.util.Collections;
 import static org.easymock.EasyMock.expect;
 
 public class AmbariAuthToLocalUserDetailsServiceTest extends EasyMockSupport {
+  @Before
+  public void setup() {
+    // These system properties need to be set to properly configure the 
KerberosName object when
+    // a krb5.conf file is not available
+    System.setProperty("java.security.krb5.realm", "EXAMPLE.COM");
+    System.setProperty("java.security.krb5.kdc", "localhost");
+  }
+
   @Test
   public void loadUserByUsernameSuccess() throws Exception {
     AmbariKerberosAuthenticationProperties properties = new 
AmbariKerberosAuthenticationProperties();
@@ -55,10 +64,6 @@ public class AmbariAuthToLocalUserDetailsServiceTest extends 
EasyMockSupport {
 
     replayAll();
 
-    // These system properties need to be set to properly configure the 
KerberosName object when
-    // a krb5.conf file is not available
-    System.setProperty("java.security.krb5.realm", "EXAMPLE.COM");
-    System.setProperty("java.security.krb5.kdc", "localhost");
     UserDetailsService userdetailsService = new 
AmbariAuthToLocalUserDetailsService(configuration, users);
 
     UserDetails userDetails = 
userdetailsService.loadUserByUsername("us...@example.com");

Reply via email to