ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From me...@apache.org
Subject ranger git commit: RANGER-2187 : External Group search fails on Ranger UI when installed with postgres
Date Sat, 11 Aug 2018 14:07:57 GMT
Repository: ranger
Updated Branches:
  refs/heads/ranger-1 ee10b9fd1 -> 798e9e4dd


RANGER-2187 : External Group search fails on Ranger UI when installed with postgres

Signed-off-by: Mehul Parikh <mehul@apache.org>


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

Branch: refs/heads/ranger-1
Commit: 798e9e4dda46cd190fa115eb8108280db525f40a
Parents: ee10b9f
Author: Bhavik Patel <bhavikpatel552@gmail.com>
Authored: Fri Aug 10 15:50:07 2018 +0530
Committer: Mehul Parikh <mehul@apache.org>
Committed: Sat Aug 11 19:37:43 2018 +0530

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/rest/XUserREST.java          | 4 ++--
 .../src/main/java/org/apache/ranger/service/XGroupService.java   | 2 +-
 .../src/test/java/org/apache/ranger/rest/TestXUserREST.java      | 4 ++--
 .../test/java/org/apache/ranger/service/TestXGroupService.java   | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/798e9e4d/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java b/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
index da33968..7d4bba8 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java
@@ -218,8 +218,8 @@ public class XUserREST {
 				request, xGroupService.sortFields);
 		searchUtil.extractString(request, searchCriteria, "name", "group name", null);
 		searchUtil.extractInt(request, searchCriteria, "isVisible", "Group Visibility");
-		searchUtil.extractString(request, searchCriteria, "groupSource", "group source", null);
-//		searchUtil.extractInt(request, searchCriteria, "groupSource", "group source");
+//		searchUtil.extractString(request, searchCriteria, "groupSource", "group source", null);
+		searchUtil.extractInt(request, searchCriteria, "groupSource", "group source");
 		return xUserMgr.searchXGroups(searchCriteria);
 	}
 

http://git-wip-us.apache.org/repos/asf/ranger/blob/798e9e4d/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java b/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
index ddcd287..22de05b 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
@@ -65,7 +65,7 @@ public class XGroupService extends XGroupServiceBase<XXGroup, VXGroup>
{
 		searchFields.add(new SearchField("name", "obj.name",
 				SearchField.DATA_TYPE.STRING, SearchField.SEARCH_TYPE.PARTIAL));
 		searchFields.add(new SearchField("groupSource", "obj.groupSource",
-				SearchField.DATA_TYPE.STRING, SearchField.SEARCH_TYPE.FULL));
+				SearchField.DATA_TYPE.INTEGER, SearchField.SEARCH_TYPE.FULL));
 
 		searchFields.add(new SearchField("isVisible", "obj.isVisible",
 				SearchField.DATA_TYPE.INTEGER, SearchField.SEARCH_TYPE.FULL ));

http://git-wip-us.apache.org/repos/asf/ranger/blob/798e9e4d/security-admin/src/test/java/org/apache/ranger/rest/TestXUserREST.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/rest/TestXUserREST.java b/security-admin/src/test/java/org/apache/ranger/rest/TestXUserREST.java
index de21213..7b5a874 100644
--- a/security-admin/src/test/java/org/apache/ranger/rest/TestXUserREST.java
+++ b/security-admin/src/test/java/org/apache/ranger/rest/TestXUserREST.java
@@ -327,7 +327,7 @@ public class TestXUserREST {
 	
 		Mockito.when(searchUtil.extractString(request, testSearchCriteria, "name", "group name",
null)).thenReturn("");
 		Mockito.when(searchUtil.extractInt(request, testSearchCriteria, "isVisible", "Group Visibility")).thenReturn(1);
-		Mockito.when(searchUtil.extractString(request, testSearchCriteria, "groupSource", "group
source", null)).thenReturn("");
+		Mockito.when(searchUtil.extractInt(request, testSearchCriteria, "groupSource", "group source")).thenReturn(1);
 		VXGroupList testvXGroupList=createxGroupList();
 		Mockito.when(xUserMgr.searchXGroups(testSearchCriteria)).thenReturn(testvXGroupList);
 		VXGroupList outputvXGroupList=xUserRest.searchXGroups(request);
@@ -336,7 +336,7 @@ public class TestXUserREST {
 		Mockito.verify(searchUtil).extractCommonCriterias((HttpServletRequest)Mockito.any() ,(List<SortField>)Mockito.any());
 		Mockito.verify(searchUtil).extractString(request, testSearchCriteria, "name", "group name",
null);
 		Mockito.verify(searchUtil).extractInt(request, testSearchCriteria, "isVisible", "Group
Visibility");
-		Mockito.verify(searchUtil).extractString(request, testSearchCriteria, "groupSource", "group
source", null);
+		Mockito.verify(searchUtil).extractInt(request, testSearchCriteria, "groupSource", "group
source");
 		assertNotNull(outputvXGroupList);
 		assertEquals(outputvXGroupList.getTotalCount(),testvXGroupList.getTotalCount());
 		assertEquals(outputvXGroupList.getClass(),testvXGroupList.getClass());

http://git-wip-us.apache.org/repos/asf/ranger/blob/798e9e4d/security-admin/src/test/java/org/apache/ranger/service/TestXGroupService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/service/TestXGroupService.java
b/security-admin/src/test/java/org/apache/ranger/service/TestXGroupService.java
index 85490dd..7624345 100644
--- a/security-admin/src/test/java/org/apache/ranger/service/TestXGroupService.java
+++ b/security-admin/src/test/java/org/apache/ranger/service/TestXGroupService.java
@@ -40,7 +40,7 @@ import java.util.Date;
 import org.apache.ranger.common.StringUtil;
 import org.apache.ranger.common.db.BaseDao;
 
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.Silent.class)
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestXGroupService {
 


Mime
View raw message