All work

 

problem with mongodb testcase for testMongoDBID

Description

public void function testMongoDBID() skip="isNotSupported" { var id = MongoDBID(); // TODO something changed with testbox var objectId = deserializeJson(serializeJson(id)).objectId; // HACK $assert.key(objectId,"date"); $assert.key(objectId,"timestamp"); //$assert.key(objectId,"id"); var dateSeed = now().add("d",-1) id = MongoDBID(dateSeed); $assert.isEqual(dateSeed,id.getDate()); var idSeed = "56be2538ddd75f08acde1e46"; id = MongoDBID(idSeed); $assert.isEqual(idSeed,id.toString()); }

was

public void function testMongoDBID() skip="isNotSupported" { if(isNotSupported()) return; var id = MongoDBID(); $assert.key(id,"date"); $assert.key(id,"timestamp"); $assert.key(id,"id"); var dateSeed = now().add("d",-1) id = MongoDBID(dateSeed); $assert.isEqual(dateSeed,id.getDate()); var idSeed = "56be2538ddd75f08acde1e46"; id = MongoDBID(idSeed); $assert.isEqual(idSeed,id.toString()); }

this somehow stopped working with new versions of testbox, its returning an iterator

as in interm step, the json trick partially handled it, not sure what broke?

Environment

None

relates to

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 7 December 2024 at 14:19
Updated 10 December 2024 at 18:49

Activity

Michael Offner 
10 December 2024 at 18:49

Problem here is that MongoDBID() does not return a struct, it returns a collection, but the function key( expects a struct, so this is a exception in the test case.

Zac Spitzer 
10 December 2024 at 15:25
(edited)

caused by https://ortussolutions.atlassian.net/browse/TESTBOX-408

workaround in place

var _id = MongoDBID(); var id = {}; // workaround https://ortussolutions.atlassian.net/browse/TESTBOX-370 structAppend(id, _id);