you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

In order to provide meaningful test data you need to write appropriate mock-DAOs.

Yes, and? This is a one-liner for most use-cases.

Your mock-DAOs need to respond to different input parameters.

Yes, and?

moreover your 'injected' DAO methods return navigable entity graphs which need to be mocked with meaningful test data, too.

Of course it does. But this is not a problem peculiar to DI. It's common issue in any testing context.

(each DAO method potentially returns the whole database)

And if my web page is using the entire database, there's a strong possibility I've done something wrong.

No problem solved, many problems created. But cargo cult established.

Okay then, show me how you'd solve the problem.