Provide deleted object to KeyValueTemplate instead of deleting entities by Id.
Closes #438
This commit is contained in:
@@ -138,7 +138,7 @@ public class SimpleKeyValueRepository<T, ID> implements KeyValueRepository<T, ID
|
||||
|
||||
Assert.notNull(entity, "The given entity must not be null!");
|
||||
|
||||
deleteById(entityInformation.getRequiredId(entity));
|
||||
operations.delete(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.springframework.data.repository.core.support.PersistentEntityInformat
|
||||
* @author Christoph Strobl
|
||||
* @author Eugene Nikiforov
|
||||
* @author Jens Schauder
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class SimpleKeyValueRepositoryUnitTests {
|
||||
@@ -108,7 +109,7 @@ class SimpleKeyValueRepositoryUnitTests {
|
||||
repo.save(one);
|
||||
repo.delete(one);
|
||||
|
||||
verify(opsMock, times(1)).delete(eq(one.getId()), eq(Foo.class));
|
||||
verify(opsMock, times(1)).delete(eq(one));
|
||||
}
|
||||
|
||||
@Test // DATACMNS-525
|
||||
|
||||
Reference in New Issue
Block a user