kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject [kylin] 04/10: minor, add null case.
Date Wed, 04 Apr 2018 04:12:15 GMT
This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit febabc400944ab71f4bb3106394b37b1be21f49d
Author: tttMelody <245915794@qq.com>
AuthorDate: Mon Mar 26 13:06:32 2018 +0800

    minor, add null case.
---
 .../test/java/org/apache/kylin/rest/util/AclUtilTest.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/server/src/test/java/org/apache/kylin/rest/util/AclUtilTest.java b/server/src/test/java/org/apache/kylin/rest/util/AclUtilTest.java
index 18e5bf5..217abe8 100644
--- a/server/src/test/java/org/apache/kylin/rest/util/AclUtilTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/util/AclUtilTest.java
@@ -42,6 +42,18 @@ public class AclUtilTest extends ServiceTestBase {
     AclUtil aclUtil;
 
     @Test
+    public void testNull() {
+        // ADMIN will go into hasRole first.
+        swichUser("ANALYST", Constant.ROLE_ANALYST);
+        try {
+            aclUtil.hasProjectAdminPermission(null);
+            Assert.fail("expecting some AlreadyExistsException here");
+        } catch (Exception e) {
+            Assert.assertEquals("Access is denied", e.getMessage());
+        }
+    }
+
+    @Test
     public void testBasic() throws IOException {
         final String PROJECT = "default";
         final String ANALYST = "ANALYST";

-- 
To stop receiving notification emails like this one, please contact
shaofengshi@apache.org.

Mime
View raw message