Repository: ranger
Updated Branches:
  refs/heads/master 4f55c97f2 -> 49142eb1b


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

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


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

Branch: refs/heads/master
Commit: 49142eb1b8a31f7ff575eafe74a902bebaf854e3
Parents: 4f55c97
Author: Bhavik Patel <bhavikpatel...@gmail.com>
Authored: Fri Aug 10 15:50:07 2018 +0530
Committer: Mehul Parikh <me...@apache.org>
Committed: Sat Aug 11 19:36:51 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/49142eb1/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/49142eb1/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/49142eb1/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/49142eb1/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 {
 

Reply via email to