ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From me...@apache.org
Subject [2/2] ranger git commit: RANGER-2101 : Testcases Improvement to follow best practices
Date Mon, 14 May 2018 09:53:09 GMT
RANGER-2101 : Testcases Improvement to follow best practices


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

Branch: refs/heads/master
Commit: df4c01307b0542f8c80b6f3b31f34472ff76a307
Parents: 7a216a8
Author: Mehul Parikh <mehul@apache.org>
Authored: Mon May 14 14:33:08 2018 +0530
Committer: Mehul Parikh <mehul@apache.org>
Committed: Mon May 14 14:33:08 2018 +0530

----------------------------------------------------------------------
 .../java/org/apache/ranger/biz/TestRangerBizUtil.java     |  1 -
 .../test/java/org/apache/ranger/rest/TestAssetREST.java   | 10 ++++------
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/df4c0130/security-admin/src/test/java/org/apache/ranger/biz/TestRangerBizUtil.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/biz/TestRangerBizUtil.java b/security-admin/src/test/java/org/apache/ranger/biz/TestRangerBizUtil.java
index 81bc548..7dda83e 100644
--- a/security-admin/src/test/java/org/apache/ranger/biz/TestRangerBizUtil.java
+++ b/security-admin/src/test/java/org/apache/ranger/biz/TestRangerBizUtil.java
@@ -708,7 +708,6 @@ public class TestRangerBizUtil {
         public void testCheckUserAccessibleSuccessForAdmin(){
                 Collection<String> roleList = new ArrayList<String>();
                 roleList.add(RangerConstants.ROLE_SYS_ADMIN);
-                roleList.contains(RangerConstants.ROLE_ADMIN_AUDITOR);
                 Mockito.when(userMgr.getRolesByLoginId(vXUser.getName())).thenReturn(
                                 roleList);
                 Mockito.when(vXUser.getUserRoleList()).thenReturn(roleList);

http://git-wip-us.apache.org/repos/asf/ranger/blob/df4c0130/security-admin/src/test/java/org/apache/ranger/rest/TestAssetREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/rest/TestAssetREST.java b/security-admin/src/test/java/org/apache/ranger/rest/TestAssetREST.java
index ce6971d..8054d1e 100644
--- a/security-admin/src/test/java/org/apache/ranger/rest/TestAssetREST.java
+++ b/security-admin/src/test/java/org/apache/ranger/rest/TestAssetREST.java
@@ -943,11 +943,10 @@ public class TestAssetREST {
         @Test
         public void testGetReportLogsForAuditAdmin() {
                 SearchCriteria searchCriteria = new SearchCriteria();
-                List<SortField> sortFields = null;
                 List<VXTrxLog> vXTrxLogs = new ArrayList<VXTrxLog>();
                 VXTrxLogList vXTrxLogList = new VXTrxLogList();
                 vXTrxLogList.setVXTrxLogs(vXTrxLogs);
-                Mockito.when(searchUtil.extractCommonCriterias(request, sortFields)).thenReturn(searchCriteria);
+                Mockito.when(searchUtil.extractCommonCriterias(request, xTrxLogService.sortFields)).thenReturn(searchCriteria);
                 Mockito.when(searchUtil.extractString((HttpServletRequest) Mockito.any(),
                                 (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(),
Mockito.anyString()))
                                 .thenReturn("test");
@@ -967,18 +966,17 @@ public class TestAssetREST {
                 Mockito.verify(searchUtil, Mockito.times(2)).extractDate((HttpServletRequest)
Mockito.any(),
                                 (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(),
Mockito.anyString());
                 Mockito.verify(assetMgr).getReportLogs(searchCriteria);
-                Mockito.verify(searchUtil).extractCommonCriterias(request, sortFields);
+                Mockito.verify(searchUtil).extractCommonCriterias(request, xTrxLogService.sortFields);
         }
 
 
         @Test
         public void testGetReportLogsForAuditKeyAdmin() {
                 SearchCriteria searchCriteria = new SearchCriteria();
-                List<SortField> sortFields = null;
                 List<VXTrxLog> vXTrxLogs = new ArrayList<VXTrxLog>();
                 VXTrxLogList vXTrxLogList = new VXTrxLogList();
                 vXTrxLogList.setVXTrxLogs(vXTrxLogs);
-                Mockito.when(searchUtil.extractCommonCriterias(request, sortFields)).thenReturn(searchCriteria);
+                Mockito.when(searchUtil.extractCommonCriterias(request, xTrxLogService.sortFields)).thenReturn(searchCriteria);
                 Mockito.when(searchUtil.extractString((HttpServletRequest) Mockito.any(),
                                 (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(),
Mockito.anyString()))
                                 .thenReturn("test");
@@ -998,7 +996,7 @@ public class TestAssetREST {
                 Mockito.verify(searchUtil, Mockito.times(2)).extractDate((HttpServletRequest)
Mockito.any(),
                                 (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(),
Mockito.anyString());
                 Mockito.verify(assetMgr).getReportLogs(searchCriteria);
-                Mockito.verify(searchUtil).extractCommonCriterias(request, sortFields);
+                Mockito.verify(searchUtil).extractCommonCriterias(request, xTrxLogService.sortFields);
         }
 
 	public Map<String, String> getSampleConfig() {


Mime
View raw message