andrey-kuznetsov commented on a change in pull request #6904: IGNITE-12220
URL: https://github.com/apache/ignite/pull/6904#discussion_r331589093
 
 

 ##########
 File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/security/cache/CacheOperationPermissionCheckTest.java
 ##########
 @@ -82,12 +137,50 @@ private void testCrudCachePermissions(boolean isClient) 
throws Exception {
             c -> c.containsKey("key"),
             c -> c.remove("key"),
             c -> c.removeAll(Collections.singleton("key")),
-            IgniteCache::clear,
             c -> c.replace("key", "value"),
             c -> c.putIfAbsent("key", "value"),
             c -> c.getAndPut("key", "value"),
             c -> c.getAndRemove("key"),
-            c -> c.getAndReplace("key", "value")
+            c -> c.getAndReplace("key", "value"),
+            IgniteCache::clear
         );
     }
+
+    protected void checkOperations(Ignite node) {
+        for (Consumer<IgniteCache<String, String>> c : operations()) {
+            c.accept(node.cache(ALL_PERM_TEST_CACHE));
+            c.accept(node.cache(NEW_CACHE)); // if defaultAllowAll == false, 
there will be exeption
+
+            assertThrowsWithCause(() -> 
c.accept(node.cache(CREATE_TEST_CACHE)), SecurityException.class);
+        }
+    }
+
+    protected SecurityPermissionSet 
getSecurityPermissionSet(SecurityPermission... systemPerms) {
 
 Review comment:
   It's better to inline this method. Then we'll get some code duplication, but 
test method will be more understandable.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to