Remove use of Apache Geode internal o.a.g.internal.AbstractRegion API in the GemFireUtilsTests class.

This commit is contained in:
John Blum
2022-01-10 15:14:38 -08:00
parent 543fb3da29
commit c832baed70

View File

@@ -38,7 +38,6 @@ import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.client.ClientRegionShortcut;
import org.apache.geode.internal.cache.AbstractRegion;
/**
* Unit Tests for {@link GemFireUtils}.
@@ -175,12 +174,11 @@ public class GemFireUtilsTests {
@Test
@SuppressWarnings("rawtypes")
// TODO: Remove use of Apache Geode internal API (AbstractRegion).
public void clientRegionWithServerProxyIsNonLocalClientRegion() {
ClientCache mockClientCache = mock(ClientCache.class);
AbstractRegion mockRegion = mock(AbstractRegion.class);
ServerProxyCapableRegion mockRegion = mock(ServerProxyCapableRegion.class);
RegionAttributes mockRegionAttributes = mock(RegionAttributes.class);
@@ -199,12 +197,11 @@ public class GemFireUtilsTests {
@Test
@SuppressWarnings("rawtypes")
// TODO: Remove use of Apache Geode internal API (AbstractRegion).
public void clientRegionWithNoPoolAndNoServerProxyIsNotNonLocalClientRegion() {
ClientCache mockClientCache = mock(ClientCache.class);
AbstractRegion mockRegion = mock(AbstractRegion.class);
ServerProxyCapableRegion mockRegion = mock(ServerProxyCapableRegion.class);
RegionAttributes mockRegionAttributes = mock(RegionAttributes.class);
@@ -244,12 +241,11 @@ public class GemFireUtilsTests {
@Test
@SuppressWarnings("rawtypes")
// TODO: Remove use of Apache Geode internal API (AbstractRegion).
public void peerRegionWithServerProxyIsNotNonLocalClientRegion() {
Cache mockPeerCache = mock(Cache.class);
AbstractRegion mockRegion = mock(AbstractRegion.class);
ServerProxyCapableRegion mockRegion = mock(ServerProxyCapableRegion.class);
RegionAttributes mockRegionAttributes = mock(RegionAttributes.class);
@@ -436,4 +432,10 @@ public class GemFireUtilsTests {
.filter(it -> !it.name().toLowerCase().contains("proxy"))
.forEach(it -> assertThat(GemFireUtils.isProxy(it)).isFalse());
}
interface ServerProxyCapableRegion<K, V> extends Region<K, V> {
boolean hasServerProxy();
}
}