diff --git a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java
index d3d68d2c..3986e4d6 100644
--- a/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java
+++ b/spring-data-geode/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java
@@ -46,7 +46,7 @@ import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
/**
- * This Template class simplifies Apache Geode data access operations, converting Apache Geode
+ * The {@link GemfireTemplate} class simplifies Apache Geode data access operations, converting Apache Geode
* {@link GemFireCheckedException GemFireCheckedExceptions} and {@link GemFireException GemFireExceptions} into
* Spring {@link DataAccessException DataAccessExceptions}, following the org.springframework.dao
* {@link Exception} hierarchy.
@@ -242,6 +242,17 @@ public class GemfireTemplate extends GemfireAccessor implements GemfireOperation
}
}
+ @Override
+ public void removeAll(Collection> keys) {
+
+ try {
+ getRegion().removeAll(keys);
+ }
+ catch (GemFireException cause) {
+ throw convertGemFireAccessException(cause);
+ }
+ }
+
@Override
public V replace(K key, V value) {
diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateUnitTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateUnitTests.java
index 400dd07f..80d014b9 100644
--- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateUnitTests.java
+++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateUnitTests.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.gemfire;
import static org.assertj.core.api.Assertions.assertThat;
@@ -25,15 +24,20 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.geode.GemFireCheckedException;
-import org.apache.geode.GemFireException;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.RegionService;
@@ -43,17 +47,11 @@ import org.apache.geode.cache.query.Query;
import org.apache.geode.cache.query.QueryService;
import org.apache.geode.cache.query.SelectResults;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.gemfire.test.support.AbstractUnitAndIntegrationTestsWithMockSupport;
/**
- * Unit tests for {@link GemfireTemplate}
+ * Unit Tests for {@link GemfireTemplate}
*
* @author Costin Leau
* @author David Turanski
@@ -62,10 +60,13 @@ import org.springframework.data.gemfire.test.support.AbstractUnitAndIntegrationT
* @see org.mockito.Mock
* @see org.mockito.Mockito
* @see org.mockito.junit.MockitoJUnitRunner
+ * @see org.apache.geode.cache.Region
+ * @see org.apache.geode.cache.client.ClientCache
+ * @see org.apache.geode.cache.query.Query
+ * @see org.apache.geode.cache.query.QueryService
+ * @see org.apache.geode.cache.query.SelectResults
* @see org.springframework.data.gemfire.GemfireTemplate
- * @see AbstractUnitAndIntegrationTestsWithMockSupport
- * @see org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer
- * @see org.springframework.test.context.ContextConfiguration
+ * @see org.springframework.data.gemfire.test.support.AbstractUnitAndIntegrationTestsWithMockSupport
*/
@SuppressWarnings("unused")
@RunWith(MockitoJUnitRunner.class)
@@ -86,7 +87,8 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
private RegionService mockRegionService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
+
when(mockRegion.getRegionService()).thenReturn(mockRegionService);
when(mockRegionService.getQueryService()).thenReturn(mockQueryService);
when(mockQueryService.newQuery(anyString())).thenReturn(mockQuery);
@@ -96,6 +98,7 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
@Test
public void constructWithNonNullRegionIsSuccessful() {
+
GemfireTemplate localTemplate = new GemfireTemplate(mockRegion);
assertThat(localTemplate).isNotNull();
@@ -120,6 +123,7 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
@Test
public void executeWithGemfireCallbackUsesNativeRegion() {
+
template.setExposeNativeRegion(true);
assertThat(template.isExposeNativeRegion()).isTrue();
@@ -127,13 +131,10 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
final AtomicBoolean callbackInvoked = new AtomicBoolean(false);
- template.execute(new GemfireCallback