我正在为 Oracle (10g) 存储过程编写测试工具。我打算使用@Transactional
测试来运行存储过程,以便在测试结束时回滚事务。所以我的测试看起来像:
@ContextConfiguration(locations = "classpath:spring/ITestAssembly.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class ContentGenerationRunnerTest {
@Autowired
private JdbcTemplate jdbcTemplate;
@Test
@Transactional
public void contentIncShouldRun() throws Exception {
new ContentGenerationRunner().runVclBec(jdbcTemplate);
}
}
我可以断言已经进行了正确的更新,因为测试会话的本地更改将在测试方法中可见。
然而,为了做出更严格的断言,能够检查会话中已调用但尚未提交的 DML 语句的完整列表会很方便。有没有办法让我看到这个?