I have an application which I suspect to leak some class references.
To expose that buggy behaviour, we wrote a test : BundleUnloadIT
In that test, I use
Assertions.assertThat(weakReference.isEnqueued())
.as("weak reference should have been enqueued, but is not").isTrue();
To test if my reference is correctly gc'ed. But whatever I try to do, the reference is never enqueued. So I suspect some reference to that class is leaking somewhere.
So ... am I using the right method to test my class is unloaded ?
And if not, how can I properly do that test ?
And if it is, there is a reference leaked somewhere. how can I find it ?