private boolean createPeerWithPR() {
    RegionAttributes ra = PartitionedRegionTestHelper.createRegionAttrsForPR(0, 10);
    PartitionAttributesImpl pa = new PartitionAttributesImpl();
    pa.setAll(ra.getPartitionAttributes());
    pa.setTotalNumBuckets(17);

    Region<Object, Object> region = CacheFactory.getAnyInstance()
        .createRegionFactory()
        .setPartitionAttributes(pa)
        .create(PR_REGION_NAME);

    assertThat(region).isNotNull();
    return Boolean.TRUE;
  }
Dunit Test to validate OnRegion function execution with REST APIs

@since GemFire 8.0
geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java