geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject incubator-geode git commit: GEODE-17: in tests spell out what commands needs what permission
Date Thu, 31 Mar 2016 17:50:49 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-17-2 8f937757c -> b61c70d38


GEODE-17: in tests spell out what commands needs what permission


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

Branch: refs/heads/feature/GEODE-17-2
Commit: b61c70d38c9f1a566fab8b5b29959075efd77ac5
Parents: 8f93775
Author: Jinmei Liao <jiliao@pivotal.io>
Authored: Thu Mar 31 10:50:36 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Thu Mar 31 10:50:36 2016 -0700

----------------------------------------------------------------------
 .../security/DataCommandsSecurityTest.java      | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b61c70d3/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/DataCommandsSecurityTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/DataCommandsSecurityTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/DataCommandsSecurityTest.java
index bae03f8..6cc63fa 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/DataCommandsSecurityTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/DataCommandsSecurityTest.java
@@ -86,8 +86,10 @@ public class DataCommandsSecurityTest {
     assertThatThrownBy(() -> bean.processCommand("rebalance --include-region=region1")).isInstanceOf(SecurityException.class)
         .hasMessageContaining("REGION:REBALANCE");
 
-    assertThatThrownBy(() -> bean.processCommand("export data --region=region1 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class);
-    assertThatThrownBy(() -> bean.processCommand("import data --region=region1 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class);
+    assertThatThrownBy(() -> bean.processCommand("export data --region=region1 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class)
+        .hasMessageContaining("REGION:EXPORT");
+    assertThatThrownBy(() -> bean.processCommand("import data --region=region1 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class)
+        .hasMessageContaining("REGION:IMPORT");
 
     assertThatThrownBy(() -> bean.processCommand("put --key=key1 --value=value1 --region=region1")).isInstanceOf(SecurityException.class)
         .hasMessageContaining("REGION:PUT");
@@ -104,19 +106,21 @@ public class DataCommandsSecurityTest {
   @Test
   public void testNoAccessToRegion(){
     assertThatThrownBy(() -> bean.processCommand("rebalance --include-region=region2")).isInstanceOf(SecurityException.class)
-        .hasMessageStartingWith("Access Denied: Not authorized for REGION:REBALANCE");
+        .hasMessageContaining("REGION:REBALANCE");
 
-    assertThatThrownBy(() -> bean.processCommand("export data --region=region2 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class);
-    assertThatThrownBy(() -> bean.processCommand("import data --region=region2 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class);
+    assertThatThrownBy(() -> bean.processCommand("export data --region=region2 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class)
+        .hasMessageContaining("REGION:EXPORT");
+    assertThatThrownBy(() -> bean.processCommand("import data --region=region2 --file=foo.txt
--member=value")).isInstanceOf(SecurityException.class)
+        .hasMessageContaining("REGION:IMPORT");
 
     assertThatThrownBy(() -> bean.processCommand("put --key=key1 --value=value1 --region=region2")).isInstanceOf(SecurityException.class)
-        .hasMessageStartingWith("Access Denied: Not authorized for REGION:PUT");
+        .hasMessageContaining("REGION:PUT");
 
     assertThatThrownBy(() -> bean.processCommand("get --key=key1 --region=region2")).isInstanceOf(SecurityException.class)
-        .hasMessageStartingWith("Access Denied: Not authorized for REGION:GET");
+        .hasMessageContaining("REGION:GET");
 
     assertThatThrownBy(() -> bean.processCommand("query --query='SELECT * FROM /region2'")).isInstanceOf(SecurityException.class)
-        .hasMessageStartingWith("Access Denied: Not authorized for QUERY:EXECUTE");
+        .hasMessageContaining("QUERY:EXECUTE");
   }
 
 }


Mime
View raw message