From 816c1da248e3a5d5ef2f1d47bfe3240267c7aa59 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 12 Feb 2019 10:47:12 +0100 Subject: [PATCH] DATAMONGO-2196 - Polishing. Fix stubbing in test that sneaked in through a back port not considering the change which method was used for entity removal. Original pull request: #641. --- .../data/mongodb/core/MongoTemplateUnitTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java index 41699e641..aa3103e1a 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java @@ -146,7 +146,7 @@ public class MongoTemplateUnitTests extends MongoOperationsUnitTests { when(collection.withReadPreference(any())).thenReturn(collection); when(collection.replaceOne(any(), any(), any(ReplaceOptions.class))).thenReturn(updateResult); when(collection.withWriteConcern(any())).thenReturn(collectionWithWriteConcern); - when(collectionWithWriteConcern.deleteOne(any(Bson.class), any())).thenReturn(deleteResult); + when(collectionWithWriteConcern.deleteMany(any(Bson.class), any())).thenReturn(deleteResult); when(findIterable.projection(any())).thenReturn(findIterable); when(findIterable.sort(any(org.bson.Document.class))).thenReturn(findIterable); when(findIterable.collation(any())).thenReturn(findIterable); @@ -747,7 +747,7 @@ public class MongoTemplateUnitTests extends MongoOperationsUnitTests { template.remove(person); verify(collection).withWriteConcern(eq(WriteConcern.UNACKNOWLEDGED)); - verify(collectionWithWriteConcern).deleteOne(any(Bson.class), any()); + verify(collectionWithWriteConcern).deleteMany(any(Bson.class), any()); } @Test // DATAMONGO-1518