@Test
  public void executeThrowsIfRegionIsNotReplicated() throws Exception {
    Properties config = new Properties();
    config.put(MCAST_PORT, "0");
    config.put(LOCATORS, "");
    getCache(config);

    AttributesFactory factory = new AttributesFactory();
    factory.setDataPolicy(DataPolicy.EMPTY); // ie, a NON-REPLICATED region

    Region region = getCache().createRegion(regionName, factory.create());

    Function function = new TestFunction(true, TEST_FUNCTION2);
    FunctionService.registerFunction(function);

    Execution execution = FunctionService.onRegion(region).setArguments(true);

    assertThatThrownBy(() -> execution.execute(function.getId()))
        .isInstanceOf(FunctionException.class)
        .hasMessageStartingWith("No Replicated Region found for executing function");
  }
TODO: extract to IntegrationTest with RegressionTest suffix
<p>
TODO: this test has nothing to do with PartitionedRegions. Move it to a FunctionService test
<p>
TRAC #41832: Function execution should throw Exceptions when any configuration is not valid
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRFunctionExecutionWithResultSenderDUnitTest.java