DatabaseConnection connection = createMock(DatabaseConnection.class);
@SuppressWarnings("unchecked")
PreparedDelete<Foo> delete = createMock(PreparedDelete.class);
CompiledStatement compiledStmt = createMock(CompiledStatement.class);
expect(delete.compile(connection, StatementType.DELETE)).andReturn(compiledStmt);
expect(compiledStmt.runUpdate()).andThrow(new SQLException("expected"));
compiledStmt.close();
StatementExecutor<Foo, String> statementExec =
new StatementExecutor<Foo, String>(databaseType, tableInfo, null);
replay(connection, compiledStmt, delete);
try {