DATAGEODE-4 - Adapt to API changes in repository interfaces.

This commit is contained in:
Oliver Gierke
2017-05-03 13:42:22 +02:00
committed by John Blum
parent 2f34d88672
commit d01819214c
13 changed files with 78 additions and 182 deletions

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.data.gemfire.repository;
import java.io.Serializable;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;
@@ -28,8 +26,7 @@ import org.springframework.data.repository.CrudRepository;
* @see java.io.Serializable
* @see org.springframework.data.repository.CrudRepository
*/
@SuppressWarnings("unused")
public interface GemfireRepository<T, ID extends Serializable> extends CrudRepository<T, ID> {
public interface GemfireRepository<T, ID> extends CrudRepository<T, ID> {
/**
* Returns all entities sorted by the given options.

View File

@@ -15,88 +15,17 @@
*/
package org.springframework.data.gemfire.repository;
import java.io.Serializable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import lombok.NonNull;
import lombok.Value;
/**
* Simple value object to hold an entity alongside an external key the entity shall be stored under.
*
* @author Oliver Gierke
*/
public final class Wrapper<T, KEY extends Serializable> {
private final KEY key;
private final T entity;
/**
* The entity to handle as well as the key.
*
* @param entity the application domain object/entity to wrap.
* @param key must not be {@literal null}.
*/
public Wrapper(T entity, KEY key) {
Assert.notNull(key);
this.entity = entity;
this.key = key;
}
/**
* @return the key
*/
public KEY getKey() {
return key;
}
/**
* @return the entity
*/
public T getEntity() {
return entity;
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object value) {
if (value == this) {
return true;
}
if (!(value instanceof Wrapper)) {
return false;
}
Wrapper<?, ?> that = (Wrapper<?, ?>) value;
return (this.key.equals(that.key) && ObjectUtils.nullSafeEquals(this.entity, that.entity));
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
int result = 17;
result += 31 * key.hashCode();
result += 31 * ObjectUtils.nullSafeHashCode(entity);
return result;
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return ObjectUtils.nullSafeToString(getEntity());
}
@Value
public class Wrapper<T, KEY> {
T entity;
@NonNull KEY key;
}

View File

@@ -16,8 +16,6 @@
package org.springframework.data.gemfire.repository.query;
import java.io.Serializable;
import org.springframework.data.gemfire.mapping.GemfirePersistentEntity;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.repository.core.support.PersistentEntityInformation;
@@ -32,7 +30,7 @@ import org.springframework.data.repository.core.support.PersistentEntityInformat
* @see org.springframework.data.gemfire.repository.query.GemfireEntityInformation
* @see org.springframework.data.repository.core.support.PersistentEntityInformation
*/
public class DefaultGemfireEntityInformation<T, ID extends Serializable> extends PersistentEntityInformation<T, ID>
public class DefaultGemfireEntityInformation<T, ID> extends PersistentEntityInformation<T, ID>
implements GemfireEntityInformation<T, ID> {
private final GemfirePersistentEntity<T> entity;

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.data.gemfire.repository.query;
import java.io.Serializable;
import org.apache.geode.cache.Region;
import org.springframework.data.repository.core.EntityInformation;
@@ -25,7 +23,7 @@ import org.springframework.data.repository.core.EntityInformation;
*
* @author Oliver Gierke
*/
public interface GemfireEntityInformation<T, ID extends Serializable> extends EntityInformation<T, ID> {
public interface GemfireEntityInformation<T, ID> extends EntityInformation<T, ID> {
/**
* Returns the name of the {@link Region} the entity is held in.

View File

@@ -16,7 +16,7 @@
package org.springframework.data.gemfire.repository.support;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.*;
import java.io.Serializable;
import java.lang.reflect.Method;
@@ -81,7 +81,8 @@ public class GemfireRepositoryFactory extends RepositoryFactorySupport {
*/
@Override
@SuppressWarnings("unchecked")
public <T, ID extends Serializable> GemfireEntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
public <T, ID> GemfireEntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
GemfirePersistentEntity<T> entity = (GemfirePersistentEntity<T>) mappingContext.getPersistentEntity(domainClass)
.orElseThrow(() -> newIllegalArgumentException("Unable to resolve PersistentEntity for type [%s]", domainClass));

View File

@@ -16,10 +16,7 @@
package org.springframework.data.gemfire.repository.support;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -41,6 +38,8 @@ import org.springframework.data.gemfire.repository.Wrapper;
import org.springframework.data.gemfire.repository.query.QueryString;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.data.repository.core.EntityInformation;
import org.springframework.data.util.StreamUtils;
import org.springframework.data.util.Streamable;
import org.springframework.util.Assert;
/**
@@ -81,8 +80,8 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
*/
@Override
public <U extends T> U save(U entity) {
ID id = entityInformation.getId(entity).orElseThrow(
() -> newIllegalArgumentException("ID for entity [%s] is required", entity));
ID id = entityInformation.getRequiredId(entity);
template.put(id, entity);
@@ -94,16 +93,14 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
* @see org.springframework.data.repository.CrudRepository#save(java.lang.Iterable)
*/
@Override
public <U extends T> Iterable<U> save(Iterable<U> entities) {
public <U extends T> Iterable<U> saveAll(Iterable<U> entities) {
Map<ID, U> entitiesToSave = new HashMap<>();
for (U entity : entities) {
ID id = entityInformation.getId(entity).orElseThrow(
() -> newIllegalArgumentException("ID for entity [%s] is required", entity));
entitiesToSave.put(id, entity);
}
entities.forEach(entity -> {
entitiesToSave.put(entityInformation.getRequiredId(entity), entity);
});
template.putAll(entitiesToSave);
return entitiesToSave.values();
@@ -134,20 +131,19 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
/*
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#exists(java.io.Serializable)
* @see org.springframework.data.repository.CrudRepository#existsById(java.lang.Object)
*/
@Override
public boolean exists(ID id) {
return findOne(id).isPresent();
public boolean existsById(ID id) {
return findById(id).isPresent();
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#findOne(java.io.Serializable)
* @see org.springframework.data.repository.CrudRepository#findById(java.lang.Object)
*/
@Override
@SuppressWarnings("unchecked")
public Optional<T> findOne(ID id) {
public Optional<T> findById(ID id) {
return Optional.ofNullable(template.get(id));
}
@@ -180,16 +176,12 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
/*
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#findAll(java.lang.Iterable)
* @see org.springframework.data.repository.CrudRepository#findAllById(java.lang.Iterable)
*/
@Override
@SuppressWarnings("unchecked")
public Collection<T> findAll(Iterable<ID> ids) {
List<ID> parameters = new ArrayList<>();
for (ID id : ids) {
parameters.add(id);
}
public Collection<T> findAllById(Iterable<ID> ids) {
List<ID> parameters = Streamable.of(ids).stream().collect(StreamUtils.toUnmodifiableList());
return CollectionUtils.<ID, T>nullSafeMap(template.getAll(parameters)).values().stream()
.filter(Objects::nonNull).collect(Collectors.toList());
@@ -197,10 +189,10 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
/*
* (non-Javadoc)
* @see org.springframework.data.repository.CrudRepository#delete(java.io.Serializable)
* @see org.springframework.data.repository.CrudRepository#deleteById(java.lang.Object)
*/
@Override
public void delete(ID id) {
public void deleteById(ID id) {
template.remove(id);
}
@@ -210,7 +202,7 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
*/
@Override
public void delete(T entity) {
delete(entityInformation.getId(entity).orElseThrow(() -> new IllegalArgumentException("ID is required")));
deleteById(entityInformation.getRequiredId(entity));
}
/*
@@ -218,10 +210,8 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
* @see org.springframework.data.repository.CrudRepository#delete(java.lang.Iterable)
*/
@Override
public void delete(Iterable<? extends T> entities) {
for (T entity : entities) {
delete(entity);
}
public void deleteAll(Iterable<? extends T> entities) {
entities.forEach(this::delete);
}
/*
@@ -229,7 +219,7 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
* @see org.apache.geode.cache.Region#getAttributes()
* @see org.apache.geode.cache.RegionAttributes#getDataPolicy()
*/
boolean isPartitioned(Region region) {
boolean isPartitioned(Region<?, ?> region) {
return (region != null && region.getAttributes() != null
&& isPartitioned(region.getAttributes().getDataPolicy()));
}
@@ -247,7 +237,7 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
* @see org.apache.geode.cache.Region#getRegionService()
* @see org.apache.geode.cache.Cache#getCacheTransactionManager()
*/
boolean isTransactionPresent(Region region) {
boolean isTransactionPresent(Region<?, ?> region) {
return (region.getRegionService() instanceof Cache
&& isTransactionPresent(((Cache) region.getRegionService()).getCacheTransactionManager()));
}
@@ -261,8 +251,7 @@ public class SimpleGemfireRepository<T, ID extends Serializable> implements Gemf
}
/* (non-Javadoc) */
@SuppressWarnings("unchecked")
void doRegionClear(Region region) {
<K> void doRegionClear(Region<K, ?> region) {
region.removeAll(region.keySet());
}

View File

@@ -12,7 +12,7 @@
*/
package org.springframework.data.gemfire.client;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;
import java.util.Arrays;
import java.util.List;
@@ -82,7 +82,6 @@ public class GemFireDataSourceIntegrationTests extends ClientServerIntegrationTe
}
@Test
@SuppressWarnings("unused")
public void gemfireServerDataSourceCreated() {
Pool pool = applicationContext.getBean("gemfirePool", Pool.class);
@@ -108,7 +107,7 @@ public class GemFireDataSourceIntegrationTests extends ClientServerIntegrationTe
assertThat(repository.save(daveMathews)).isSameAs(daveMathews);
Optional<Person> result = repository.findOne(1L);
Optional<Person> result = repository.findById(1L);
assertThat(result.isPresent()).isTrue();
assertThat(result.get().getFirstname()).isEqualTo("Dave");

View File

@@ -49,7 +49,7 @@ public class RepositoryClient {
}
public Person find(Long id) {
return getPersonRepository().findOne(id).orElse(null);
return getPersonRepository().findById(id).orElse(null);
}
public Person save(Person person) {

View File

@@ -16,7 +16,7 @@
package org.springframework.data.gemfire.repository.sample;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;
import java.util.Optional;
@@ -72,7 +72,7 @@ public class AnimalRepositoryTest {
assertThat(catRepo.count()).isEqualTo(3L);
assertThat(dogRepo.count()).isEqualTo(2L);
Optional<Animal> foundFelix = catRepo.findOne(1L);
Optional<Animal> foundFelix = catRepo.findById(1L);
assertThat(foundFelix.isPresent()).isTrue();
assertThat(foundFelix.get()).isEqualTo(felix);
@@ -85,7 +85,7 @@ public class AnimalRepositoryTest {
assertThat(foundCerberusTheCat).isEqualTo(cerberus);
assertThat(catRepo.findBy("Cerberus")).isEqualTo(foundCerberusTheCat);
assertThat(catRepo.findOne(3L).orElse(null)).isEqualTo(foundCerberusTheCat);
assertThat(catRepo.findById(3L).orElse(null)).isEqualTo(foundCerberusTheCat);
Animal foundFido = dogRepo.findBy("Fido");
@@ -95,6 +95,6 @@ public class AnimalRepositoryTest {
assertThat(foundCerberusTheDog).isEqualTo(cerberus);
assertThat(dogRepo.findBy("Cerberus")).isEqualTo(foundCerberusTheDog);
assertThat(dogRepo.findOne(3L).orElse(null)).isEqualTo(foundCerberusTheDog);
assertThat(dogRepo.findById(3L).orElse(null)).isEqualTo(foundCerberusTheDog);
}
}

View File

@@ -17,10 +17,7 @@
package org.springframework.data.gemfire.repository.sample;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Collections;
@@ -207,7 +204,7 @@ public class SubRegionRepositoryIntegrationTest {
@Test
public void testSubregionRepositoryInteractions() {
assertThat(programmersRepo.findOne("JamesGosling").orElse(null)).isEqualTo(PROGRAMMER_USER_DATA.get("JamesGosling"));
assertThat(programmersRepo.findById("JamesGosling").orElse(null)).isEqualTo(PROGRAMMER_USER_DATA.get("JamesGosling"));
List<Programmer> javaProgrammers = programmersRepo.findDistinctByProgrammingLanguageOrderByUsernameAsc("Java");
@@ -256,8 +253,8 @@ public class SubRegionRepositoryIntegrationTest {
@Test
public void testIdenticallyNamedSubregionDataAccess() {
assertThat(adminUserRepo.findOne("supertool").orElse(null)).isEqualTo(getAdminUser("supertool"));
assertThat(guestUserRepo.findOne("joeblow").orElse(null)).isEqualTo(getGuestUser("joeblow"));
assertThat(adminUserRepo.findById("supertool").orElse(null)).isEqualTo(getAdminUser("supertool"));
assertThat(guestUserRepo.findById("joeblow").orElse(null)).isEqualTo(getGuestUser("joeblow"));
List<RootUser> rootUsers = adminUserRepo.findDistinctByUsername("zeus");

View File

@@ -16,7 +16,7 @@
package org.springframework.data.gemfire.repository.support;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.*;
import java.util.Arrays;
import java.util.Collection;
@@ -97,7 +97,7 @@ public class SimpleGemfireRepositoryIntegrationTests {
template.put(carter.getId(), carter);
template.put(leroi.getId(), leroi);
Collection<Person> result = repository.findAll(Arrays.asList(carter.getId(), leroi.getId()));
Collection<Person> result = repository.findAllById(Arrays.asList(carter.getId(), leroi.getId()));
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(2);
@@ -106,7 +106,7 @@ public class SimpleGemfireRepositoryIntegrationTests {
@Test
public void findAllWithIdsReturnsNoMatches() {
Collection<Person> results = repository.findAll(Arrays.asList(1L, 2L));
Collection<Person> results = repository.findAllById(Arrays.asList(1L, 2L));
assertThat(results).isNotNull();
assertThat(results).isEmpty();
@@ -121,7 +121,7 @@ public class SimpleGemfireRepositoryIntegrationTests {
template.put(kurt.getId(), kurt);
template.put(eddie.getId(), eddie);
Collection<Person> results = repository.findAll(Arrays.asList(0L, 1L, 2L, 4L));
Collection<Person> results = repository.findAllById(Arrays.asList(0L, 1L, 2L, 4L));
assertThat(results).isNotNull();
assertThat(results).hasSize(2);
@@ -148,13 +148,13 @@ public class SimpleGemfireRepositoryIntegrationTests {
assertThat(repository.save(oliverGierke)).isEqualTo(oliverGierke);
assertThat(repository.count()).isEqualTo(1L);
assertThat(repository.findOne(oliverGierke.getId()).orElse(null)).isEqualTo(oliverGierke);
assertThat(repository.findById(oliverGierke.getId()).orElse(null)).isEqualTo(oliverGierke);
assertThat(repository.findAll()).isEqualTo(Collections.singletonList(oliverGierke));
repository.delete(oliverGierke);
assertThat(repository.count()).isEqualTo(0L);
assertThat(repository.findOne(oliverGierke.getId()).orElse(null)).isNull();
assertThat(repository.findById(oliverGierke.getId()).orElse(null)).isNull();
assertThat(repository.findAll()).isEmpty();
}
@@ -166,7 +166,7 @@ public class SimpleGemfireRepositoryIntegrationTests {
Person jonBloom = new Person(2L, "Jon", "Bloom");
Person juanBlume = new Person(3L, "Juan", "Blume");
repository.save(Arrays.asList(johnBlum, jonBloom, juanBlume));
repository.saveAll(Arrays.asList(johnBlum, jonBloom, juanBlume));
assertThat(template.getRegion().size()).isEqualTo(3);
assertThat(template.<Long, Person>get(johnBlum.getId())).isEqualTo(johnBlum);

View File

@@ -16,10 +16,7 @@
package org.springframework.data.gemfire.repository.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import java.io.Serializable;
import java.util.ArrayList;
@@ -152,7 +149,7 @@ public class SimpleGemfireRepositoryTransactionalIntegrationTest {
public void saveAll(final Iterable<Customer> customers) {
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override protected void doInTransactionWithoutResult(final TransactionStatus status) {
customerRepository.save(customers);
customerRepository.saveAll(customers);
}
});
}

View File

@@ -16,19 +16,11 @@
package org.springframework.data.gemfire.repository.support;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.assertj.core.api.Assertions.*;
import static org.hamcrest.Matchers.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import java.util.ArrayList;
import java.util.Arrays;
@@ -38,7 +30,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
@@ -120,21 +111,21 @@ public class SimpleGemfireRepositoryUnitTests {
protected EntityInformation<Animal, Long> mockEntityInformation() {
EntityInformation<Animal, Long> mockEntityInformation = mock(EntityInformation.class);
doAnswer(new Answer<Optional<Long>>() {
doAnswer(new Answer<Long>() {
private final AtomicLong idSequence = new AtomicLong(0L);
@Override
public Optional<Long> answer(InvocationOnMock invocation) throws Throwable {
public Long answer(InvocationOnMock invocation) throws Throwable {
Animal argument = invocation.getArgument(0);
argument.setId(resolveId(argument.getId()));
return Optional.of(argument.getId());
return argument.getId();
}
private Long resolveId(Long id) {
return (id != null ? id : idSequence.incrementAndGet());
}
}).when(mockEntityInformation).getId(any(Animal.class));
}).when(mockEntityInformation).getRequiredId(any(Animal.class));
return mockEntityInformation;
}
@@ -213,7 +204,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
Iterable<Animal> savedAnimals = repository.save(animals);
Iterable<Animal> savedAnimals = repository.saveAll(animals);
assertThat(savedAnimals).isNotNull();
@@ -267,8 +258,8 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
assertThat(repository.exists(1L)).isTrue();
assertThat(repository.exists(10L)).isFalse();
assertThat(repository.existsById(1L)).isTrue();
assertThat(repository.existsById(10L)).isFalse();
}
@Test
@@ -283,8 +274,8 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
assertThat(repository.findOne(1L).orElse(null)).isEqualTo(dog);
assertThat(repository.findOne(10L).isPresent()).isFalse();
assertThat(repository.findById(1L).orElse(null)).isEqualTo(dog);
assertThat(repository.findById(10L).isPresent()).isFalse();
}
@Test
@@ -305,7 +296,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository = new SimpleGemfireRepository<>(
newGemfireTemplate(mockRegion), mockEntityInformation());
Collection<Animal> animalsFound = repository.findAll(Arrays.asList(1L, 3L));
Collection<Animal> animalsFound = repository.findAllById(Arrays.asList(1L, 3L));
assertThat(animalsFound).isNotNull();
assertThat(animalsFound).hasSize(2);
@@ -332,7 +323,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
Collection<Animal> animalsFound = repository.findAll(Arrays.asList(1L, 2L, 3L));
Collection<Animal> animalsFound = repository.findAllById(Arrays.asList(1L, 2L, 3L));
assertThat(animalsFound).isNotNull();
assertThat(animalsFound).isEmpty();
@@ -362,7 +353,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
Collection<Animal> animalsFound = repository.findAll(Arrays.asList(0L, 1L, 2L, 4L));
Collection<Animal> animalsFound = repository.findAllById(Arrays.asList(0L, 1L, 2L, 4L));
assertThat(animalsFound).isNotNull();
assertThat(animalsFound).hasSize(2);
@@ -378,7 +369,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
repository.delete(1L);
repository.deleteById(1L);
verify(mockRegion, times(1)).remove(eq(1L));
}
@@ -402,7 +393,7 @@ public class SimpleGemfireRepositoryUnitTests {
SimpleGemfireRepository<Animal, Long> repository =
new SimpleGemfireRepository<>(newGemfireTemplate(mockRegion), mockEntityInformation());
repository.delete(Arrays.asList(newAnimal(1L, "bird"), newAnimal(2L, "cat"),
repository.deleteAll(Arrays.asList(newAnimal(1L, "bird"), newAnimal(2L, "cat"),
newAnimal(3L, "dog")));
verify(mockRegion, times(1)).remove(eq(1L));