Skip to content

Commit 816c1da

Browse files
committed
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.
1 parent 5a78f19 commit 816c1da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void setUp() {
146146
when(collection.withReadPreference(any())).thenReturn(collection);
147147
when(collection.replaceOne(any(), any(), any(ReplaceOptions.class))).thenReturn(updateResult);
148148
when(collection.withWriteConcern(any())).thenReturn(collectionWithWriteConcern);
149-
when(collectionWithWriteConcern.deleteOne(any(Bson.class), any())).thenReturn(deleteResult);
149+
when(collectionWithWriteConcern.deleteMany(any(Bson.class), any())).thenReturn(deleteResult);
150150
when(findIterable.projection(any())).thenReturn(findIterable);
151151
when(findIterable.sort(any(org.bson.Document.class))).thenReturn(findIterable);
152152
when(findIterable.collation(any())).thenReturn(findIterable);
@@ -747,7 +747,7 @@ public void removeShouldApplyWriteConcern() {
747747
template.remove(person);
748748

749749
verify(collection).withWriteConcern(eq(WriteConcern.UNACKNOWLEDGED));
750-
verify(collectionWithWriteConcern).deleteOne(any(Bson.class), any());
750+
verify(collectionWithWriteConcern).deleteMany(any(Bson.class), any());
751751
}
752752

753753
@Test // DATAMONGO-1518

0 commit comments

Comments
 (0)