1. By the time you’re asking yourself things like “[should you] set the flush-mode to FlushMode.ALWAYS for your tests?” you’re pretty much doomed, and all of your (unit) testing efforts will start eating up valuable time you could be spending on business logic. By this time, it should be clear that true integration testing is:

    1. Far easier to achieve
    2. More relevant to predict the outcome of what matters: Your business logic
    3. Much easier to maintain

    I personally wish people would stop unit testing database logic. There’s hardly any other programming task with a worse cost / effect ratio (or with more dogma)…

Leave a Reply

Your email address will not be published. Required fields are marked *