In a test, I'd like to make sure that associations have been loaded eagerly.
I could probably use reflection to access the entity field containing the association from my test class, asserting that it contains an initialized collection – but that seems really ugly.
Another way of asserting the desired behavior would be to fetch the entity, then tell the ORMInfrastructure that I do not expect any further database queries and then invoke some method on the entity that would trigger loading the collection.
In a test, I'd like to make sure that associations have been loaded eagerly.
I could probably use reflection to access the entity field containing the association from my test class, asserting that it contains an initialized collection – but that seems really ugly.
Another way of asserting the desired behavior would be to fetch the entity, then tell the
ORMInfrastructure
that I do not expect any further database queries and then invoke some method on the entity that would trigger loading the collection.Thoughts?