airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] branch develop updated: AIRAVATA-3030 fix typo in filtering by sharing type
Date Thu, 09 May 2019 15:34:48 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1a30837  AIRAVATA-3030 fix typo in filtering by sharing type
1a30837 is described below

commit 1a308370fccec5f042e94b09b6086d7a5c310045
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Thu May 9 11:34:38 2019 -0400

    AIRAVATA-3030 fix typo in filtering by sharing type
---
 .../airavata/sharing/registry/db/repositories/UserGroupRepository.java  | 2 +-
 .../airavata/sharing/registry/SharingRegistryServerHandlerTest.java     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
index aff580c..e23bfb7 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java
@@ -61,7 +61,7 @@ public class UserGroupRepository extends AbstractRepository<UserGroup,
UserGroup
         query += "s." + DBConstants.SharingTable.PERMISSION_TYPE_ID + " = :" + DBConstants.SharingTable.PERMISSION_TYPE_ID
+ " AND ";
         query += "g." + DBConstants.UserGroupTable.GROUP_CARDINALITY + " = :" + DBConstants.UserGroupTable.GROUP_CARDINALITY;
         if (!Arrays.asList(sharingTypes).isEmpty()) {
-            query += " AND s." + DBConstants.SharingTable.SHARING_TYPE + " = :" + DBConstants.SharingTable.SHARING_TYPE;
+            query += " AND s." + DBConstants.SharingTable.SHARING_TYPE + " IN :" + DBConstants.SharingTable.SHARING_TYPE;
         }
         query += " ORDER BY s.createdTime DESC";
         Map<String,Object> queryParameters = new HashMap<>();
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
index 75e2d0d..aa4a983 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java
@@ -380,5 +380,7 @@ public class SharingRegistryServerHandlerTest {
         List<User> entityId2SharedUsers = sharingRegistryServerHandler.getListOfSharedUsers(domainId,
entityId2, permissionTypeId1);
         Assert.assertEquals(2, entityId2SharedUsers.size());
         Assert.assertTrue("user3 and user7 in shared users", entityId2SharedUsers.contains(user3)
&& entityId2SharedUsers.contains(user7));
+        Assert.assertEquals(1, sharingRegistryServerHandler.getListOfDirectlySharedGroups(domainId,
entityId3, permissionTypeId1).size());
+        Assert.assertEquals(groupId2, sharingRegistryServerHandler.getListOfDirectlySharedGroups(domainId,
entityId3, permissionTypeId1).get(0).getGroupId());
     }
 }


Mime
View raw message