LeoColman
04/05/2019, 4:46 AMAdam Kirk
04/05/2019, 4:59 AMghedeon
04/05/2019, 5:01 AMreset()
in Mockito 🙂. It's also a sign of a poor test.LeoColman
04/05/2019, 5:01 AMgildor
04/05/2019, 5:22 AMMy object keeps a map that should be a single instance during the whole JVMI agree with @ghedeon, it looks as some bad design and hack for test
Jonathan Mew
04/05/2019, 7:31 AM@BeforeEach
fun beforeEach() {
myStaticMap.clear()
}
but it's pretty hacky and I think it'll burn you sooner or later.Mike
04/05/2019, 10:41 AMLeoColman
04/05/2019, 12:22 PMMike
04/05/2019, 2:02 PMinternal fun clear()
defined in your structure that clears it out.
Won’t be visible outside the module, but will be available to tests.
I don’t think there’s a way to ‘clear memory structure’ from code otherwise.Jonathan Mew
04/05/2019, 4:04 PMLeoColman
04/05/2019, 4:39 PM