Skip to content

Commit

Permalink
chore: added tests for field existence inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshusinghs committed Jan 16, 2025
1 parent 4614a33 commit 3aa1f1d
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,29 @@ class BookRepository {
);
}
String releasedFromMethodCall() {
return "released";
}
public void allReleasedBooksAggregate() {
String releasedAsVariable = "released";
template.aggregate(
Aggregation.newAggregation(
Aggregation.match(
where(<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">"released"</warning>).is(true)
),
Aggregation.project(
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">"released"</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedAsVariable</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedFromMethodCall()</warning>
).andInclude(
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">"released"</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedAsVariable</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedFromMethodCall()</warning>
).andExclude(
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">"released"</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedAsVariable</warning>,
<warning descr="Field \"released\" does not exist in collection \"bad_db.book\"">releasedFromMethodCall()</warning>
)
),
Book.class,
Expand Down

0 comments on commit 3aa1f1d

Please sign in to comment.