Repository: ranger
Updated Branches:
  refs/heads/master 50fb124e5 -> 11282a1ea


RANGER-1514 - Remove EasyMock dependency

Signed-off-by: Colm O hEigeartaigh <cohei...@apache.org>


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

Branch: refs/heads/master
Commit: 11282a1eae4612fb0619de7a934c776ba3f54fc8
Parents: 50fb124
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Fri Apr 14 12:13:45 2017 +0100
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Tue Apr 18 10:13:09 2017 +0100

----------------------------------------------------------------------
 plugin-kms/pom.xml                                      |  6 ++----
 .../kms/authorizer/RangerKmsAuthorizerTest.java         | 12 +++++++-----
 pom.xml                                                 |  1 -
 3 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/11282a1e/plugin-kms/pom.xml
----------------------------------------------------------------------
diff --git a/plugin-kms/pom.xml b/plugin-kms/pom.xml
index a4c47b7..344940a 100644
--- a/plugin-kms/pom.xml
+++ b/plugin-kms/pom.xml
@@ -63,10 +63,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymock</artifactId>
-            <version>${easymock.version}</version>
-            <scope>test</scope>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
         </dependency>
 
     </dependencies>

http://git-wip-us.apache.org/repos/asf/ranger/blob/11282a1e/plugin-kms/src/test/java/org/apache/ranger/authorization/kms/authorizer/RangerKmsAuthorizerTest.java
----------------------------------------------------------------------
diff --git 
a/plugin-kms/src/test/java/org/apache/ranger/authorization/kms/authorizer/RangerKmsAuthorizerTest.java
 
b/plugin-kms/src/test/java/org/apache/ranger/authorization/kms/authorizer/RangerKmsAuthorizerTest.java
index 3cff953..4c2d242 100644
--- 
a/plugin-kms/src/test/java/org/apache/ranger/authorization/kms/authorizer/RangerKmsAuthorizerTest.java
+++ 
b/plugin-kms/src/test/java/org/apache/ranger/authorization/kms/authorizer/RangerKmsAuthorizerTest.java
@@ -33,11 +33,13 @@ import 
org.apache.hadoop.crypto.key.kms.server.KMSConfiguration;
 import org.apache.hadoop.crypto.key.kms.server.KMSWebApp;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.authorize.AuthorizationException;
-import org.easymock.EasyMock;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
 
 /**
  * Policies available from admin via:
@@ -46,6 +48,7 @@ import org.junit.Test;
  *
  * The user "bob" can do anything. The group "IT" can only call the "get" 
methods
  */
+@RunWith(MockitoJUnitRunner.class)
 public class RangerKmsAuthorizerTest {
 
     private static KMSWebApp kmsWebapp;
@@ -81,10 +84,9 @@ public class RangerKmsAuthorizerTest {
         System.setProperty(KMSConfiguration.KMS_CONFIG_DIR, 
configDir.toFile().getAbsolutePath());
 
         // Start KMSWebApp
-        ServletContextEvent servletContextEvent = 
EasyMock.createMock(ServletContextEvent.class);
-        ServletContext servletContext = 
EasyMock.createMock(ServletContext.class);
-        
EasyMock.expect(servletContextEvent.getServletContext()).andReturn(servletContext).anyTimes();
-        EasyMock.replay(servletContextEvent);
+        ServletContextEvent servletContextEvent = 
Mockito.mock(ServletContextEvent.class);
+        ServletContext servletContext = Mockito.mock(ServletContext.class);
+        
Mockito.when(servletContextEvent.getServletContext()).thenReturn(servletContext);
 
         kmsWebapp = new KMSWebApp();
         kmsWebapp.contextInitialized(servletContextEvent);

http://git-wip-us.apache.org/repos/asf/ranger/blob/11282a1e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4fb62e2..e6ffb68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,7 +151,6 @@
         <commons.pool.version>1.6</commons.pool.version>
         <curator.test.version>2.7.0</curator.test.version>
         <derby.version>10.11.1.1</derby.version>
-        <easymock.version>3.4</easymock.version>
         <eclipse.jpa.version>2.5.2</eclipse.jpa.version>
         <findbugs.plugin.version>3.0.3</findbugs.plugin.version>
         <google.guava.version>17.0</google.guava.version>

Reply via email to