Helio
04/25/2021, 3:13 AM1.4.10 -> 1.4.32
and Ktor 1.4.2 -> 1.5.3
. I was definitely expecting some of Unit tests to break due to compatibility and I’ve already fixed them. However, there are still 4 of them that I’m struggling to understand what could be wrong.
When one of the unit tests starts, it adds an entity to a Global Variable with type mutableListOf<MyModel>()
. I can confirm that the value was added successfully. ArrayList@XXXX
. However, when one of the routes of my Ktor server attempt to read the value from that Global Variable, it is empty and the id of the object is now ArrayList@YYYY
. It looks like when embeddedServer(…).start()
is executed, it creates a new instance of the Global Object, hence it is empty.
I’ve already tried many things, SynchronizeListOf, add the global variable into an object, but no matter what I do the reference of the GlobalObject into Ktor is always different.
Would anyone be able to shed some light, please?
Thanks heaps.