Skip to content

Commit

Permalink
test: try to fix ci test problem
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed Jan 28, 2025
1 parent a27e03d commit 237742b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class JodaConverterPluginSpec extends Specification with BeforeAfterAll {
"JodaConverterPlugin" should {

"convert joda dates to bson dates" in {
val dateTime = new DateTime("2023-11-02")
val bsonDocument = BsonConverter.toBson(dateTime)
(bsonDocument.toString must be).equalTo("BsonDateTime{value=1698879600000}")
val dateTime = new DateTime("2023-11-02")
val bsonDocument = BsonConverter.toBson(dateTime)
val roundTripDate = new DateTime(bsonDocument.asDateTime().getValue)
(roundTripDate must be).equalTo(dateTime)
}

"convert joda duration to bson string" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class LuceneSearchSpec extends PersonSpecification {

"between filter for date value" in {
val luceneQuery = LuceneQueryConverter.parse("[2014-04-20T00:00:00Z TO 2014-04-22T23:59:59Z]", "registered")
val search = PersonDAO.find(LuceneQueryConverter.toDocument(luceneQuery), sortByBalance).resultList()
val luceneDocument = LuceneQueryConverter.toDocument(luceneQuery)
luceneDocument.toString must beEqualTo("Iterable((registered,{\"$lte\": {\"$date\": \"2014-04-22T21:59:59Z\"}, \"$gte\": {\"$date\": \"2014-04-19T22:00:00Z\"}}))")
val search = PersonDAO.find(luceneDocument, sortByBalance).resultList()
search must haveSize(10)
search.head.age mustEqual 25
search.head.name mustEqual "Allison Turner"
Expand Down

0 comments on commit 237742b

Please sign in to comment.