Skip to content

Commit

Permalink
update expected data to only show docs selected by the query
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed Jun 24, 2024
1 parent fe35bb0 commit ab5dde6
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/src/test/java/dev/morphia/test/TemplatedTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ public void testUpdate(ActionTestOptions options,

var resourceName = prepareDatabase(options);

Query<Document> apply = function.apply(getDs().find(EXAMPLE_TEST_COLLECTION, Document.class)
Query<Document> query = function.apply(getDs().find(EXAMPLE_TEST_COLLECTION, Document.class)
.disableValidation());
List<Document> actual = runUpdate(options, resourceName, apply, options.findOptions(), operators);
List<Document> actual = runUpdate(options, resourceName, query, options.findOptions(), operators);

checkExpected(options, resourceName, actual);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{ _id: ObjectId("61ba3ec9fe687fce2f042417"), item: 'nuts', quantity: 30, carrier: { name: 'Shipit', fee: 3 }, price: 9.99},
{ _id: ObjectId("61ba3ec9fe687fce2f042418"), item: 'bolts', quantity: 50, carrier: { name: 'Shipit', fee: 4 }},
{ _id: ObjectId("61ba3ec9fe687fce2f042419"), item: 'washers', quantity: 10, carrier: { name: 'Shipit', fee: 1 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update expected to only show docs selected by the query
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{ _id: ObjectId("61bb51211b83c864e3bbe037"), item: 'nuts', quantity: 30, carrier: { name: 'Shipit', fee: 3 }, price: 9.99},
{ _id: ObjectId("61bb51211b83c864e3bbe038"), item: 'bolts', quantity: 50, carrier: { name: 'Shipit', fee: 4 }, price: 9.99}
{ "item": "washers", "quantity": 10, "carrier": { "name": "Shipit", "fee": 1 } }
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
code block had extra text in it
the "expected" data was simply the changed docs. updated to include all docs regardless of update.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{ item: 'Pens', quantity: 350, tags: [ 'school', 'office' ], exclude: false },
{ item: 'Erasers', quantity: 15, tags: [ 'school', 'home' ], exclude: false },
{ "item": "Maps", "tags": [ "office", "storage" ] },
{ item: 'Books', quantity: 5, tags: [ 'school', 'storage', 'home' ], exclude: false }
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
code block had extra text in it
the "expected" data was simply the changed docs. updated to include all docs regardless of update.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
{ _id: ObjectId("61ba66e2fe687fce2f042423"), item: 'nuts', quantity: 30, carrier: { name: 'Shipit', fee: 3 }, price: 9.99 },
{ _id: ObjectId("61ba66e2fe687fce2f042424"), item: 'bolts', quantity: 50, carrier: { name: 'Shipit', fee: 4 }, price: 9.99 },
{ _id: ObjectId("61ba66e2fe687fce2f042425"), item: 'washers', quantity: 10, carrier: { name: 'Shipit', fee: 1 } }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update expected to only show docs selected by the query
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{ "item": "Pens", "quantity": 350, "tags": [ "school", "office" ] },
{ "item": "Erasers", "quantity": 15, "tags": [ "school", "home" ] },
{ "item": "Maps", "tags": [ "office", "storage" ], exclude: true },
{ "item": "Books", "quantity": 5, "tags": [ "school", "storage", "home" ] }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update expected to only show docs selected by the query

0 comments on commit ab5dde6

Please sign in to comment.