[英]How to isolate the integration Tests?
When having a database operations in many integration Tests, how to be sure that the state of the DataBase is the same before and after any Test in an automatic manner (with some framework) ? 在许多集成测试中都有数据库操作时,如何确保自动(使用某些框架)进行任何测试之前和之后的数据库状态相同?
I am not interested in the manual manner ( @Before
@After
) 我对手动方式不感兴趣(
@Before
@After
)
What we do at my company is that 我们在我公司所做的是
This works finy in many scenarios, however, it may be problematic if you try to test parts of your application that are working with nested transactions. 这在许多情况下都能正常工作,但是,如果您尝试测试应用程序中处理嵌套事务的部分,则可能会出现问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.