SecureFunctionServiceImpl implements SecureFunctionService { @Override public List<Object> executeFunctionOnGroups(String functionID, Object arguments, List<String> groupNameList) { Function<Object> function = authorizeAndGetFunction(null, functionID, arguments); @SuppressWarnings("unchecked") Execution<Object, Object, List<Object>> execution = FunctionService.onMember(groupNameList.toArray(new String[0])); return executeFunction(execution, functionID, function, arguments); } SecureFunctionServiceImpl(InternalCache internalCache, Security security); @Override List<Object> executeFunctionOnRegion(String functionID, String regionName,
      Object arguments, Set<?> keyFilter); @Override List<Object> executeFunctionOnMember(String functionID, Object arguments,
      List<String> memberNameList); @Override List<Object> executeFunctionOnGroups(String functionID, Object arguments,
      List<String> groupNameList);  }
@Test public void executeFunctionOnGroupsWithoutAuthorization() { when(function.getRequiredPermissions(null, null)) .thenReturn(Collections.singleton(new ResourcePermission(CLUSTER, WRITE, REGION, ALL))); assertThatThrownBy( () -> functionService.executeFunctionOnGroups(FUNCTION_ID, null, Collections.singletonList("group"))) .isInstanceOf(NotAuthorizedException.class); }