Skip to content

Commit 0fce63f

Browse files
committed
Extend testUpdateArrayMatch_ObjectId #232
1 parent 27e0deb commit 0fce63f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test-common/src/main/java/de/bwaldvogel/mongo/backend/AbstractBackendTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3490,11 +3490,15 @@ void testUpdateArrayMatch_ObjectId() {
34903490
collection.insertOne(json("_id: 1")
34913491
.append("myArray", List.of(new Document("_id", new ObjectId(123, 456)))));
34923492

3493-
collection.updateOne(
3493+
UpdateResult updateResult = collection.updateOne(
34943494
and(eq("_id", 1), eq("myArray._id", new ObjectId(123, 456))),
34953495
set("myArray.$.name", "new name")
34963496
);
34973497

3498+
assertThat(updateResult.getMatchedCount()).isEqualTo(1);
3499+
assertThat(updateResult.getModifiedCount()).isEqualTo(1);
3500+
assertThat(updateResult.getUpsertedId()).isNull();
3501+
34983502
assertThat(collection.find())
34993503
.containsExactly(json("_id: 1")
35003504
.append("myArray", List.of(

0 commit comments

Comments
 (0)