Create an in-memory database structure from an Oracle instance

后端 未结 4 755
一生所求
一生所求 2021-01-30 10:56

I have an application where many \"unit\" tests use a real connection to an Oracle database during their execution.

As you can imagine, these tests take too muc

4条回答
  •  误落风尘
    2021-01-30 11:50

    What are your unit tests for? If they test the proper working of DDLs and stored procedures then you should write the tests "closer" to Oracle: either without Java code or without Spring and other nice web interfaces at all focusing on the db.

    If you want to test the application logic implemented in Java and Spring then you may use mock objects/database connection to make your tests independent of the database.

    If you want to test the working as a whole (what is against the modular development and testing principle) then you may virtualize your database and test on that instance without having the risk of doing some nasty irreversible modifications.

提交回复
热议问题