atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ames...@apache.org
Subject atlas git commit: ATLAS-2038: Minor refactoring to use org.apache.commons.codec.binary.Base64.
Date Mon, 21 Aug 2017 18:42:59 GMT
Repository: atlas
Updated Branches:
  refs/heads/master 2841b85ec -> 149625731


ATLAS-2038: Minor refactoring to use org.apache.commons.codec.binary.Base64.


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

Branch: refs/heads/master
Commit: 1496257312abf06a471efc54c844634d7200b9dd
Parents: 2841b85
Author: ashutoshm <amestry@hortonworks.com>
Authored: Mon Aug 21 11:41:44 2017 -0700
Committer: ashutoshm <amestry@hortonworks.com>
Committed: Mon Aug 21 11:41:44 2017 -0700

----------------------------------------------------------------------
 .../web/filters/AtlasAuthenticationSimpleFilterIT.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/14962573/webapp/src/test/java/org/apache/atlas/web/filters/AtlasAuthenticationSimpleFilterIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/filters/AtlasAuthenticationSimpleFilterIT.java
b/webapp/src/test/java/org/apache/atlas/web/filters/AtlasAuthenticationSimpleFilterIT.java
index 25414fd..00436fb 100644
--- a/webapp/src/test/java/org/apache/atlas/web/filters/AtlasAuthenticationSimpleFilterIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/filters/AtlasAuthenticationSimpleFilterIT.java
@@ -19,7 +19,7 @@ package org.apache.atlas.web.filters;
 import org.apache.atlas.web.security.BaseSecurityTest;
 import org.testng.Assert;
 import org.testng.annotations.Test;
-import sun.misc.BASE64Encoder;
+import org.apache.commons.codec.binary.Base64;
 import javax.ws.rs.core.Response;
 import java.net.HttpURLConnection;
 import java.net.URL;
@@ -30,8 +30,7 @@ import static org.testng.Assert.assertEquals;
  *
  */
 public class AtlasAuthenticationSimpleFilterIT extends BaseSecurityTest {
-    private BASE64Encoder enc = new sun.misc.BASE64Encoder();
-
+    private Base64 enc = new Base64();
 
     @Test(enabled = true)
     public void testSimpleLoginForValidUser() throws Exception {
@@ -39,7 +38,7 @@ public class AtlasAuthenticationSimpleFilterIT extends BaseSecurityTest
{
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("GET");
         String userpassword = "admin:admin"; // right password
-        String encodedAuthorization = enc.encode(userpassword.getBytes());
+        String encodedAuthorization = enc.encodeToString(userpassword.getBytes());
         connection.setRequestProperty("Authorization", "Basic " +
                 encodedAuthorization);
         connection.connect();
@@ -68,7 +67,7 @@ public class AtlasAuthenticationSimpleFilterIT extends BaseSecurityTest
{
             HttpURLConnection connection = (HttpURLConnection) url.openConnection();
             connection.setRequestMethod("GET");
             String userpassword = "rangertagsync:rangertagsync"; //right password with no
policy for taxonomies api
-            String encodedAuthorization = enc.encode(userpassword.getBytes());
+            String encodedAuthorization = enc.encodeToString(userpassword.getBytes());
             connection.setRequestProperty("Authorization", "Basic " +
                     encodedAuthorization);
             connection.connect();
@@ -87,7 +86,7 @@ public class AtlasAuthenticationSimpleFilterIT extends BaseSecurityTest
{
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection.setRequestMethod("GET");
         String userpassword = "admin:admin1"; //wrong password
-        String encodedAuthorization = enc.encode(userpassword.getBytes());
+        String encodedAuthorization = enc.encodeToString(userpassword.getBytes());
         connection.setRequestProperty("Authorization", "Basic " +
                 encodedAuthorization);
         connection.connect();


Mime
View raw message