Add additional assertions asserting that the 'Books' (client) Region DataPolicy is configured correctly.

Additionally, assert that the 'spring.data.gemfire.cache.client.region.shortcut' is not set (and specifically not set to 'LOCAL').
This commit is contained in:
John Blum
2021-01-20 14:10:28 -08:00
parent 06a19a0787
commit bba6e61011

View File

@@ -25,10 +25,12 @@ import java.util.stream.Collectors;
import javax.net.ssl.SSLContext;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.GemFireCache;
import org.apache.geode.cache.Region;
@@ -110,6 +112,9 @@ import example.app.books.model.ISBN;
@SuppressWarnings("unused")
public class SecureClusterAwareConfigurationIntegrationTests extends ForkingClientServerIntegrationTestsSupport {
private static final String SPRING_DATA_GEMFIRE_CACHE_CLIENT_REGION_SHORTCUT_PROPERTY =
"spring.data.gemfire.cache.client.region.shortcut";
@BeforeClass
public static void startGeodeServer() throws IOException {
startGemFireServer(TestGeodeServerConfiguration.class,
@@ -120,6 +125,18 @@ public class SecureClusterAwareConfigurationIntegrationTests extends ForkingClie
@Qualifier("booksTemplate")
private GemfireTemplate booksTemplate;
@Before
public void assertBooksClientRegionIsProxy() {
assertThat(System.getProperties())
.doesNotContainKeys(SPRING_DATA_GEMFIRE_CACHE_CLIENT_REGION_SHORTCUT_PROPERTY);
assertThat(this.booksTemplate).isNotNull();
assertThat(this.booksTemplate.getRegion()).isNotNull();
assertThat(this.booksTemplate.getRegion().getAttributes()).isNotNull();
assertThat(this.booksTemplate.getRegion().getAttributes().getDataPolicy()).isEqualTo(DataPolicy.EMPTY);
}
@Test
public void clientServerConfigurationAndConfigurationIsSuccessful() {