As shown by OGM-503, tests solely based on the entity structure are not sufficient to reveal issues with the persistent representation of entities/assocations (in that particular case, elements of ordered collections where stored several times in MongoDB when updating them, but via the entity only the latest - and thus correct - entry was visible).
So we need some test infrastructure which allows for assertions on the persistent format. One way would be native quieries (e.g. to count certain elements), but this would tie such assertion to a specific store. So some more abstract means of such assertions is desirable, e.g. in form of an API such as getNumberOfEntries(Assocation a, AssocationKey k).
|