@Test
  public void testBug35381() throws Exception {
    final Host host = Host.getHost(0);
    final String name = getUniqueName();
    final int[] ports = new int[1]; // 1 server in this test

    final int whichVM = 0;
    final VM vm = Host.getHost(0).getVM(whichVM);
    vm.invoke(new CacheSerializableRunnable("Create cache server") {
      @Override
      public void run2() throws CacheException {
        LogWriterUtils.getLogWriter().info("[testBug35381] Create BridgeServer");
        getSystem();
        AttributesFactory factory = new AttributesFactory();
        factory.setScope(Scope.LOCAL);
        Region region = createRegion(name, factory.create());
        assertNotNull(region);
        assertNotNull(getRootRegion().getSubregion(name));
        region.put("KEY-1", "VAL-1");

        try {
          bridgeServerPort = startBridgeServer(0);
        } catch (IOException e) {
          LogWriterUtils.getLogWriter().error("startBridgeServer threw IOException", e);
          fail("startBridgeServer threw IOException ", e);
        }

        assertTrue(bridgeServerPort != 0);

        LogWriterUtils.getLogWriter().info("[testBug35381] port=" + bridgeServerPort);
        LogWriterUtils.getLogWriter().info("[testBug35381] serverMemberId=" + getMemberId());
      }
    });
    ports[whichVM] = vm.invoke(ClientRegisterInterestDUnitTest::getBridgeServerPort);
    assertTrue(ports[whichVM] != 0);

    LogWriterUtils.getLogWriter().info("[testBug35381] create bridge client");
    Properties config = new Properties();
    config.setProperty(MCAST_PORT, "0");
    config.setProperty(LOCATORS, "");
    getSystem(config);
    getCache();

    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);

    LogWriterUtils.getLogWriter().info("[testBug35381] creating connection pool");
    boolean establishCallbackConnection = false; // SOURCE OF BUG 35381
    ClientServerTestCase.configureConnectionPool(factory, NetworkUtils.getServerHostName(host),
        ports, establishCallbackConnection, -1, -1, null);
    Region region = createRegion(name, factory.create());
    assertNotNull(getRootRegion().getSubregion(name));
    try {
      region.registerInterest("KEY-1");
      fail(
          "registerInterest failed to throw SubscriptionNotEnabledException with establishCallbackConnection set to false");
    } catch (SubscriptionNotEnabledException ignored) {
    }
  }
Tests for Bug 35381 Calling register interest if establishCallbackConnection is not set causes
cache server NPE.
geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientRegisterInterestDUnitTest.java