I have a Java application that talks to a MySQL database using Spring JDBC Templates. In one of my tests I want to simulate a table not being there in an integration test, however I cannot actually temporarily drop/recreate or rename the table in our testing database for a variety of reasons.
I also don't want to mock out the particular DAO method call that would hit the table that throws the error in case going forward we use other methods. I want to do something like intercept the sql before it goes off to the database and replace the table name (if present) with a bogus name--or something else to the same effect.
Test driven development for the win!