SecureCacheImpl implements SecureCache { @Override public Object query(String queryString, Object[] bindParameters) throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, FunctionDomainException { InternalQueryService queryService = (InternalQueryService) cache.getQueryService(); Query query = queryService.newQuery(queryString); for (String regionName : ((DefaultQuery) query).getRegionsInQuery(bindParameters)) { security.authorize(DATA, READ, regionName, ALL); } Object result = query.execute(bindParameters); if (security.needsPostProcessing()) { return postProcessQueryResults(result); } else { return result; } } SecureCacheImpl(InternalCache cache, Security security); @Override void getAll(String regionName, Iterable<K> keys, BiConsumer<K, V> successConsumer,
      BiConsumer<K, Exception> failureConsumer); @Override V get(String regionName, K key); @Override void put(String regionName, K key, V value); @Override void putAll(String regionName, Map<K, V> entries,
      BiConsumer<K, Exception> failureConsumer); @Override V remove(String regionName, K key); @Override Collection<String> getRegionNames(); @Override int getSize(String regionName); @Override Set<K> keySet(String regionName); @Override SecureFunctionService getFunctionService(); @Override void clear(String regionName); @Override V putIfAbsent(String regionName, K key, V value); @Override Object query(String queryString, Object[] bindParameters);  }
@Test public void query() throws Exception { authorize(DATA, READ, REGION, ALL); mockQuery(); String queryString = "select * from " + SEPARATOR + "region"; Object[] bindParameters = {"a"}; authorizingCache.query(queryString, bindParameters); }